1.

Write an algorithm to find the largest of 3 numbers.

Answer»
  • Step 1: Start 
  • Step 2: Read 3 numbers and store in A, B, C 
  • Step 3: Compare A and B. lf A > B then go to step 6 
  • Step 4: Compare B and C if C > B then go to step 8 
  • Step 5: print “B is largest” go to step 9 
  • Step 6: Compare A and C if C > A then go to step 8 
  • Step 7: Print”A is largest” go to step 9 
  • Step 8: Print “C is largest” 
  • Step 9: Stop


Discussion

No Comment Found

Related InterviewSolutions