Technologies
C
Write an algorithm and draw the flowchart to find whether a given number is even or odd?
  CLanguage
  Sunday, 13 Aug 2017
  36592
    0
  • Algorithm : a

    • Step 1 : Start
    • Start 2 : Read n
    • Start 3 : if (n%2 == 0), Write " even number" else Write " odd number"
    • Start 4 : Stop

Flowchart :

Write an algorithm and draw the flowchart to find whether a given number is even or odd

Example 1 : Input : 15
Output : odd number
Example 2 : Input : 12
Output : even number