code:
#include<bits/stdc++.h>
using namespace std;
int main() {
char c;
cin>>c;
while(c!=‘X’&&c!=‘x’){
if(c!=’’&&c!=’/’&&c!=’+’&&c!=’-’&&c!=’%’){
cout<<“Invalid operation. Try again.”<<endl;
while(c!=’’&&c!=’/’&&c!=’+’&&c!=’-’&&c!=’%’&&c!=‘x’&&c!=‘X’)
cin>>c;
}
else{
int x,y;
cin>>x>>y;
if(c==’’)
cout<<xy<<endl;
else if(c==’+’)
cout<<x+y<<endl;
else if(c==’/’)
cout<<x/y<<endl;
else if(c==’%’)
cout<<x%y<<endl;
else if(c==’-’)
cout<<x-y<<endl;
cin>>c;
}
}
return 0;
}