I am getting an error as timelimit exceeded can you please tell me what is the problem

#include
using namespace std;
int main() {
char ch;
long long int n,m;
if(ch==β€˜x’){

}
else{
do{
	cin>>ch;
	cin>>n>>m;

switch(ch){
	case '*' : cout<<(n*m)<<endl;
				break;
	case '%' :
	case '/' : cout<<(n/m)<<endl;
				break;
	case '+' : cout<<(n+m)<<endl;
				break;
	case '-' : cout<<(n-m)<<endl;
				break;
	//case 'x' :
	//case 'X' : break;

	default  : cout<<"Invalid operation. Try again.";
                break;
}
}while(ch!='X' or ch!='x');
}
return 0;

}

@rajharsh865
Take input n and m separately for each of the following case ("+", β€œ-”, *, β€œ%”, β€œ/” ). You don’t have to take input n and m if ch is some other character

1 Like