CJCoding With Joseph
15free / daySign inCreate account

Overflow When Parsing a Byte

Read a line and parse it into a byte (which holds 0 to 255) using byte.Parse, then print Byte: <b>. A value larger than 255 throws an OverflowException — catch it and print exactly Too big for a byte. Use top-level statements with try/catch.

Input 200 prints: Byte: 200
Input 300 prints: Too big for a byte

Expected Output:

Byte: 200

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

Hints4 available
Topics:
Exceptions
📥 Auto-Input:
200\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 · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (cw, cr, fori)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.