Technologies
C
Write an algorithm and draw the flowchart to find the largest number among the three numbers?
  CLanguage
  Sunday, 13 Aug 2017
  53400
    0
  • Algorithm : a

    • Step 1 : Start
    • Start 2 : Input a, b, c
    • Start 3 : if a > b goto step 4, otherwise goto step 5
    • Start 4 : if a > c goto step 6, otherwise goto step 8
    • Start 5 : if b > c goto step 7, otherwise goto step 8
    • Start 6 : Output "a is the largest", goto step 9
    • Start 7 : Output "b is the largest", goto step 9
    • Start 8 : Output " c is the largest", goto step 9
    • Start 9 : Stop

Flowchart :


Example : 1 Input : 15 17 56 Output : 56
Example : 2 Input : 4 16 2 Output : 16
Example : 3 Input : 64 16 23 Output : 64

  • Algorithm : a

    • Step 1 : Start
    • Start 2 : Input A, B, C
    • Start 3 : Let max = A
    • Start 4 : if B > max then max = B
    • Start 5 : if C > max then max = C
    • Start 6 : Output max is largest
    • Start 7 : Stop

Flowchart :


Example : Input : 15 17 56
Output : 56 is largest