Site icon TestingDocs.com

Flowgorithm Nested If Statements

Overview

In this tutorial, we will learn nested If statements in Flowgorithm flowchart. Nested if statements allow the programmer to check multiple conditions based on the initial outer condition result.

Nested If Statements

We can use an if statement nested inside another if statement. In general, the outside if statement is called the outer if statement. The nested if is called the inner if statement. We can make things complex and nest multiple if statements in an if statement.

Example

In the following example, we will nest an if statement inside another statement. Let’s design a flowchart to find the biggest of the 3 Numbers. Let’s assume the three numbers are distinct.

The general steps to design the flowchart are as follows:

Launch Flowgorithm.

Declare three variables.

Prompt user to enter three numbers.

In the first, if statement, check if a is the biggest among the three numbers.

If not, in the false branch of the outer if statement, check if b is the biggest.

Print the biggest number accordingly.

Sample Output

Enter the number (a) =
7
Enter the number (b) =
9
Enter the number (c) =
1
b i.e ( 9 ) is the biggest

 

Flowgorithm Tutorials

Flowgorithm flowchart tutorials on this website:

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

Flowgorithm Website

For more information on the Flowgorithm tool, please visit the official website at: http://flowgorithm.org/

Exit mobile version