#include
using namespace std;
int main() {
int a,b;
char ch;
ch=cin.get();
while((ch !=βXβ) or (ch !=βxβ)){
if(ch==β+β){
cin>>a;
cin>>b;
cout<<a+b;
ch=cin.get();
}
else if(ch==β-β){
cin>>a;
cin>>b;
cout<<a-b;
ch=cin.get();
}
else if(ch==ββ){
cin>>a;
cin>>b;
cout<<ab;
ch=cin.get();
}
else if(ch==β/β)
{
cin>>a;
cin>>b;
cout<<a/b;
ch=cin.get();
}
else if(ch==β%β){
cin>>a;
cin>>b;
cout<<a%b;
ch=cin.get();
}
else{
cout<<βInvalid operation. Try again.β;
ch=cin.get();
}
}
return 0;
}
Error..where am i going wrong
I hope Iβve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.