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.
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:
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.
Enter the number (a) =
Enter the number (b) =
Enter the number (c) =
b i.e ( 9 ) is the biggest
Flowgorithm flowchart tutorials on this website:
For more information on the Flowgorithm tool, please visit the official website at: http://flowgorithm.org/