This programs prints factorial of a number.The output it prints is 120 as the input given is 5. Change the output to see your desired results.
Run It Now!
The below example demonstrates how to use try-catch blocks to catch an exception.
The below example encounters an Arithmetic Exception as it try's to divide 42 by 0. Run It Now!