Exception Handling in C++
In this blog, I’m explaining about Exception
handling in C++
is a problem that arises during the execution of a program Exceptions
provide a way to transfer control from one part of a program to another.
exception handling is built upon three
keywords: _try, catch and throw.
throw: A program throws an exception when
a program show up. This is done using a throw keyword.
try: A try block identifies a block of a code for which
particular exceptions will be activated. It’s followed by one or more catch
catch: A program catches an exception with an
exception handler at the place in a program where you want to handle the
problem. This is done using a catch keyword.
// Exception.cpp : main project file.
cout<<"Enter first number";
cout<<"Enter second number";