Exception is an abnormal behavior of the program during runtime.
It will occur when the user gives input to the program something that is out of the scope.
To resolve this problem we can use exception handling, C++ Provide an inbuilt error handling mechanism. We also handle this without an inbuilt mechanism but that is not much efficient to handle the exception.
Keyword used in the exception handling:-
try: Try is Block of code where the chance of exception occurs.
catch: Try is Block of code that can handle the exception when occurring in the try block.
throw: It is used in try block. It will throw the exception to the catch block.