Can't pass all test cases

hello. this was my code for the calculator. I’m unable to pass all the testcases. what am I missing?

#include
using namespace std;

int main()
{

while (1)
{
char ch;
cin>> ch;

if ( ch== '+' or ch== '-' or ch== '*' or ch== '/' or ch== '%')
{
	int n1, n2;
	cin>>n1>>n2;

	switch (ch)
	{
		case '+' : cout << n1+n2 <<endl;
					break;
		case '-' : cout << n1-n2<<endl;
					break;
		case '*' : cout << n1*n2<<endl;
					break;
		case '/' : cout << n1/n2<<endl;
					break;
		case '%' : cout << n1%n2 <<endl;
					break;												
	}
	break;

}

else if (ch== 'x' or ch== 'X')
	break;


else
{
	cout<< "Invalid operation. Try again.";
	continue;
}
} 

return 0;

}

hello @yamika

check now->

works perfectly now! I added the ‘break’ in the ‘if’ block much later. before that too, it wasn’t accepting my code, maybe because i didn’t put the “\n”. should formatting errors like that really be considered failures? it can be hard for a student to figure out what is going wrong. but thank you for your help!

your output should match with output format otherwise , you will always get wa . so always take care of formatting

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.