All test cases are not running what is wrong

#include
using namespace std;

int main()
{
long int n,n1,n2;

char ch;
cin>>ch;
while(ch!='X' && ch!='x')
{
	if(ch=='+')
	{
		cin>>n1>>n2;
		n=n1+n2;
		cout<<n<<endl;

	}
	else if(ch=='-')
	{
		cin>>n1>>n2;
		n=n1-n2;
		cout<<n<<endl;

	}
	else if(ch=='*')
	{
		cin>>n1>>n2;
		n=n1*n2;
		cout<<n<<endl;
	}
	else if(ch=='/' && n2!=0)
	{
		cin>>n1>>n2;
		n=n1/n2;
		cout<<n<<endl;
	}
	else if(ch=='%' && n2!=0)
	{
		cin>>n1>>n2;
		n=n1%n2;
		cout<<n<<endl;

	}
	else
	{
		cout<<"Invalid operation. Try again.";
	}
cin>>ch;
}

return 0;
}

@Subrat
Change line 47 to cout<<“Invalid operation. Try again.”<<endl;
you missed cout<<endl;

1 Like

thank you so much it worked

@Subrat
Mark this doubt as resolved. thankyou

1 Like

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.