Algorithm to read a number and find if it is even or odd.

1. Start.

2. Read a number.

3. If the remainder of number/2 is equal to zero, then the number is even (number%2==0). Go to step 5.

4.Else the number is odd.

5. End.

No comments:

Post a Comment