TestingDocs.com
Software Testing website
  • Automation
    • Selenium
    • JBehave Framework
  • Tutorials
    • MySQL Tutorials
    • Testlink
    • Maven
    • Git
  • IDEs
    • IntelliJ IDEA
    • Eclipse
  • Flowcharts
    • Flowgorithm
    • Raptor
  • About

Flowgorithm

Flowgorithm Do While Loop Statement

Flowgorithm

Overview

In this tutorial, we will learn about the Flowgorithm Do While Loop Statement. In the Do While Loop structure, the loop statements are executed before the loop condition check. Like the While loop, the Do While loop is an indefinite loop. We can use this loop when we don’t know how many times the loop will run.

However, unlike the While statement, the Do While loop checks the condition after executing the loop statements. So the loop statements are executed at least once.

Do While Loop

To add the Do While loop to the flowchart, right-click on the control flow line and choose the Do loop statement.

 

Do While Loop Flowgorithm

 

Example

Let’s look into an example where the Do While loop is used. It’s a menu-based program to perform two actions based on the user input.

The Do While loop is natural for menu-based loops. The loop displays the menu statements and prompts the user to take different actions. Based on the user input the Do while loop executes the loop or terminates.

 

DoWhileLoopExample_Flowgorithm

 

Pseudocode

Function Main
... Demo Flowchart for Do While Loop 
... - www.TestingDocs.com
Declare Integer userChoice

Loop
 Output "Program Menu:"
 Output "1. Task1"
 Output "2. Task 2"
 Output "3. Quit"
 Output "Please choose menu option:"
 Input userChoice
 If userChoice == 1
 Output "Performing Task 1 ..........."
 End
 If userChoice == 2
 Output "Performing Task 2 ..........."
 End
Do userChoice != 3
End

Sample Output

Run the flowchart to see how the loop runs and displays the menu for the user until the user chooses to quit.

Program Menu:
1. Task1
2. Task 2
3. Quit
Please choose menu option:
1
Performing Task 1 ...........
Program Menu:
1. Task1
2. Task 2
3. Quit
Please choose menu option:
2
Performing Task 2 ...........
Program Menu:
1. Task1
2. Task 2
3. Quit
Please choose menu option:
1
Performing Task 1 ...........
Program Menu:
1. Task1
2. Task 2
3. Quit
Please choose menu option:
3

—

Flowgorithm Tutorials

https://www.testingdocs.com/flowgorithm-flowchart-tutorial/

Flowgorithm Website:

http://flowgorithm.org/

Related Posts

Print Triangle Pattern Flowchart

Flowgorithm /

Print Triangle Pattern Flowchart

Flowgorithm Breakpoint Symbol

Flowgorithm /

Flowgorithm Conditional Breakpoint Statement

File Read Declare Variables

Flowgorithm /

Flowgorithm Read Numbers from File Example

File Search Input File Flowgorithm

Flowgorithm /

Search Text File Flowchart Example

Flowgorithm Turtle Graphics Symbols

Flowgorithm /

Flowgorithm Turtle Graphics Symbols

‹ Flowgorithm While Loop Statement› User Defined Functions in Flowgorithm

Recent Posts

  • Update draw.io on Windows
  • Install RAPTOR Avalonia on CentOS
  • Download RAPTOR Avalonia Edition on Windows
  • npm doctor command
  • Build & Run CLion Project
  • Create New CLion C Project on Windows
  • Configure CLion Toolchains on Windows
  • Launch CLion IDE on Windows
  • Activate CLion IDE
  • CLion IDE for C/C++ Development

Back to Top

Links

  • Contact
  • Privacy Policy
  • Cookie Policy

www.TestingDocs.com