← Back to Loops
Question 371
Print The Evens
Print The Evens
Five whole numbers are read into a list. Print only the even ones, each on its own line and in their original order, using a for loop and the remainder operator % (value % 2 is 0 for an even value). This is the first half of a matching pair: the primes question uses the same loop shape with a harder test inside. Input: five integers, one per line, no prompts.
Expected Output:
12 10 8
= newline. The output ends with a newline — print one after the last line.
Hints2 available
Sign in to use hintsTopics:
LoopsPractice Problems
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (pr, inp, def)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.