Finding The Greatest Of Three Numbers Algorithm
1 min readMay 11, 2023
ALGORITHM:
- The program prompts the user to enter three integer values and reads them into the variables num1 ,num2 and num3.
- The program then checks which number is the greatest by comparing num1,num2 and num3
- The first condition checks if num1is greater than or equal to num2 AND num3. If this condition is true, the program prints that num1is the greatest number.
- If the first condition is false, the program moves on to the second condition, which checks if
n
is greater than or equal to num1AND num3. If this condition is true, the program prints that num2 is the greatest number. - If both the first and second conditions are false, the program moves on to the third condition, which is the default. This condition assumes that num3 is the greatest number, and it is printed as such.
- After determining the greatest number, the program ends.
FLOWCHART: