The following flowchart outlines the algorithm.

Find out a number is Even or Odd