CJCoding With Joseph
15free / daySign inCreate account

Evens And Odds Until Done

Read whole numbers one per line with the prompt Number: until the word done, counting how many are even and how many are odd with the remainder operator % (value % 2 == 0 means even, which holds for negative numbers too). After the loop print Evens: <n> and then Odds: <n> on the next line. Input: zero or more integers, one per line, then done. The prompts are part of the output and run together on one line in front of the first result.

Expected Output:

Number: Number: Number: Number: Evens: 2
Odds: 1

= newline. The output ends with a newline — print one after the last line.

Hints3 available
Topics:
Menus & Validation
📥 Auto-Input:
4\n7\n10\ndone\n
This input is automatically fed to your program's stdin
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.