MENU
Question -

Write an algorithm to find the largest among three numbers.



Answer -

The algorithm is defined as :

Step 1: Read X, Y, Z.
Step 2 : If X > Y continue step 5.
Step 3 : If Y>Z then print “Y is the largest “and continue step 7.
Step 4 : Continue step 6.
Step 5 : If X>Z then print “X is the largest “and continue step 7.
Step 6 : Print “Z is largest”.
Step 7: End.

Comment(S)

Show all Coment

Leave a Comment

Free - Previous Years Question Papers
Any questions? Ask us!
×