#include
using namespace std;
int main() {
char ch;
long long int n1,n2;
do{
cin>>ch;
switch(ch){
case β+β:
cin>>n1>>n2;
cout<<(n1+n2)<<endl;
break;
case 'β:
cin>>n1>>n2;
cout<<(n1n2)<<endl;
break;
case β-β:
cin>>n1>>n2;
cout<<(n1-n2)<<endl;
break;
case β/β:
cin>>n1>>n2;
cout<<(n1/n2)<<endl;
break;
case β%β:
cin>>n1>>n2;
cout<<(n1%n2)<<endl;
break;
case βxβ:
case βXβ:
break;
default:
cout<<βInvalid operation. Try again.β<<endl;
break;
}
}while(ch!=βxβ || ch!=βXβ);
return 0;
}
Runguard: warning: timelimit exceeded (wall time): aborting command runguard: warning: command terminated with signal 15
same code as copied here
@raghavthecoder I know, but in the normal post some operators gets removed or get interpreted as special character for formatting, also IDE helps in debugging.
From what I see in this code it seems fine, but if you could provide me the code in IDE I would have a better look.
yeah same code is worrking on codeblocks but not here
@raghavthecoder it might be possible that their is some error related to IDE. If your code works on a compiler but not another then it is a compiler issue ignore it for now.
Please resolve this doubt
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.