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.
Flowchart Output
Test the flowchart with sample numbers.
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