#include
using namespace std;
int main() {
char ch;
do{
cin>>ch;
int N1,N2;
switch(ch){
case β+β:
cin>>N1>>N2;
cout<<N1+N2<<endl;
break;
case β-β:
cin>>N1>>N2;
cout<<N1-N2<<endl;
break;
case 'β:
cin>>N1>>N2;
cout<<N1N2<<endl;
break;
case β/β:
cin>>N1>>N2;
if(N2!=0){
cout<<N1/N2<<endl;}
break;
case β%β:
cin>>N1>>N2;
if(N2!=0){
cout<<N1%N2<<endl;
break;}
case βXβ:
case βxβ:
break;
default:
cout<<βinvalid operation.Try againβ<<endl;
}}while(true);
return 0;
}
How to solve runguard error in this particular program?
hi @goutampopli12,
please send me code on ide.codingblocks.com
- login
- write (or copy paste)
- save (ctrl + s)
- send the url of that page
or send it by saving to any online editor
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.