CJCoding With Joseph
15free / daySign inCreate account

Largest Until Zero

Read whole numbers one per line until a 0 arrives (the sentinel, which is not a reading). Track the largest value seen with a while loop and print Largest: <value> after the loop; the first reading starts as the largest. If the very first line is 0 print No readings. Input: several lines, each a positive integer, the last one 0, no prompts.

Expected Output:

Largest: 9

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

Hints3 available
Topics:
Loops
📥 Auto-Input:
4\n9\n2\n0\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.