Let’s write a for
loop that will iterate from 0 to 20. For each iteration,
it will check if the current number is even or odd, and print that on the screen.
You will need the modulo (remainder) operator for this exercise.
Make sure that number 0 is not printed.
Expected output:
1 is odd
2 is even
…
…
19 is odd
20 is even
for ( ; ; ) {
}