#include<iostream>
using namespace std;
int main()
{
int a,b,c;
float d;
cout<<"Enter value for a";
cin>>a;
cout<<"Enter value for b";
cin>>b;
cout<<"Enter value for c";
cin>>c;
try
{
if((a-b)!=0)
{
d=c/(a-b);
cout<<"Result is "<<d;
}
else
{
throw(a-b);
}
}
catch(int i)
{
cout<<"Answer is infinite because a-b is"<<i;
}
return 0;
}
OUTPUT:
BY
REGU RAM SV.
إرسال تعليق