int main() {
char ch;
cin>>ch;
while(ch!=βXβ || ch!=βxβ)
{
if(ch==β+β || ch==β-β || ch==ββ || ch==β/β || ch==β%β)
{
int n1,n2;
cin>>n1>>n2;
if (ch==β+β)
{
cout<<n1+n2<<endl;
}
else if(ch==β-β)
{
cout<<n1-n2<<endl;
}
else if(ch==ββ)
{
cout<<n1*n2<<endl;
}
else if(ch==β/β)
{
cout<<n1/n2<<endl;
}
else
{
cout<<n1%n2<<endl;
}
}
else{
cout<<βInvalid operation. Try again.β<<endl;
}
}
return 0;
}
Doubt - error kindly resolve
Hello @shyama i have corrected your code and commented the mistake:
if you have any doubt you can ask here:
Happy Learning!!
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.