Print the Exception Type Name
easyQuestion 766Read an integer and print Value: <n>. If parsing fails, catch the exception and print the name of its type using ex.GetType().Name (which prints exactly FormatException for bad input). Use top-level statements with try/catch.
Input 7 prints: Value: 7
Input bad prints: FormatException
Expected output
Value: 7= newline. The output ends with a newline, so print one after the last line.
Hints2 available
Sign in to use hintsTopics
Exceptions
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.