Course Content
Flowgorithm Expressions
Flowgorithm Expressions
0/1
Debug Flowgorithm Flowchart
Debug Flowgorithm Flowchart
0/1
Flowgorithm Control Statements
Flowgorithm Control Statements
0/1
Flowgorithm Loops
Flowgorithm Loops
0/1
Flowgorithm For Loop
Flowgorithm For Loop
0/1
Flowgorithm While Loop
Flowgorithm While Loop
0/1
Flowgorithm Do Loop
Flowgorithm Do Loop
0/1
Flowgorithm Nested Loops
Flowgorithm Nested Loops
0/1
Export Flowgorithm Flowchart
Export Flowgorithm Flowchart
0/1
Flowgorithm Intermediate
About Lesson

Largest of Two Numbers Flowchart

Let’s use the knowledge to design a flowchart to determine the largest of two given numbers. 

Let’s assume the two given numbers, x and y

The number x is the largest if x > y holds True; otherwise, x is less than y, or both are equal.   

Flowchart 

Declare two numbers.

Take Input from the user.

Add an If statement to decide if x > y

  • In the True branch, print x as the largest number.
  • In the False branch to decide if x == y
    • If True, both the numbers are equal.
    • If False, then y is the largest number.

        

      

 

Largest Of Two Numbers - Main Flowchart

Flowchart Output

Test the flowchart with sample numbers.

 

Largest of Two Numbers Flowchart Output

 

In the attachment section, you will find an example flowchart that uses nested if statements to decide and to fund the largest of the two given numbers and if they are equal. 

Exercise Files
LargestOfTwoNumbers.zip
Size: 789.00 B