https://hack.codingblocks.com/practice/p/339/195
Solution -4 cases are giving wrong answer
#include
using namespace std;
int main()
{
char ch;
cin>>ch;
while((ch!='X')||(ch!='x'))
{
int x,y;
if(ch=='+')
{
cin>>x>>y;
cout<<(x+y)<<endl;
}
else if(ch=='-')
{
cin>>x>>y;
cout<<(x-y)<<endl;
}
else if(ch=='*')
{
cin>>x>>y;
cout<<(x*y)<<endl;
} else if(ch=='/')
{
cin>>x>>y;
if(y!=0)
cout<<(x/y)<<endl;
}
else if(ch=='%')
{
cin>>x>>y;
if(y!=0)
cout<<(x%y)<<endl;
}
else if((ch=='x')||(ch=='X'))
return 0;
else
{
cout<<"Invalid operation. Try again"<<endl;
}
cin>>ch;
}
return 0;
}