CJCoding With Joseph

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
Topics:
Exceptions
📥 Auto-Input:
200\n
This input is automatically fed to your program's stdin
Code Editor
1
Tab to indent · Ctrl+Enter to run · 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.