Geeky Codes is a website which aims in teaching and providing tutorials and courses on various Programming languages like Python,C,C++,JAVA and SQL. You can write your own blog on this website which if approved will be published here …
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.