#include<iostream.h>
int main()
double num, den,result;
char op;
do {
cout<<"\ncalculator- enter number :";
cin>>num;
cout<<"enter operator +,-,*,/:";
cin>>op;
cout<<enter second number:";
cin>>den;
if(op=='+') result= num+den; Run program
if(op=='-') result=num-den;
if(op=='*') result=num*den;if(op=='/') result= num/den;
cout<<result;
}
wh
ile (op!='e');
return 0;
}
No comments:
Post a Comment