Write a program that prompts the user for a positive integer and then prints out
all even numbers starting at 2 up to that integer. For example, when the user
enters 20, the program should print
2 4 6 8 10 12 14 16 18 20

Recall that a number is an even number is one that is divisible by 2. So, you’ll
need to employ the modulus operator and if the number is evenly divisible by 2,
output it.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.