Answer:
Exceptions are raised using throw statement in c++.
Step-by-step explanation:
Try block is used to keep the statements which we felt that they will raise an exception. Catch block is used to catch the exception which is thrown by the try block.
#include<iostream.h>
void main(){
int x,y,z;
try{
cout<"enter 2 numbers";
cin>>x>>y;
if(y==0)
throw y;
z=x/y;
}
catch(int x){
cout<<"exception caught";
}
}