CJCoding With Joseph
15free / daySign inCreate account

Guess The Secret Number

The secret number is 42, declared at the top (no random numbers). Read guesses with the prompt Guess: until one matches. After each wrong guess print Higher! when the guess is below the secret or Lower! when it is above, and print Correct! once the guess matches. Input: one whole number per line; the last line is 42. The prompt is part of the output, so each message follows its prompt on the same line.

Expected Output:

Guess: Higher!
Guess: Lower!
Guess: Correct!

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

Hints3 available
Topics:
Menus & Validation
📥 Auto-Input:
10\n50\n42\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.