#include<iostream>
using namespace std;
int main()
{
int num1,num2;
cout<<"please enter the first number here:";
cin>>num1;
cout<<"please enter the second number here:";
cin>>num2;
try
{
if(num2==0)
{
throw num2;
}
else
{
cout<<"the value is:"<< num1/num2<<endl;
}
}
catch(int x)
{
cout<<"ERROR:second number cannot be zero..."<<endl;
}
}
No comments:
Post a Comment