Showing slow program

please help to optimize this code, it shows your program is very slow on submitting the code.

please help me. code is given below:

#include
using namespace std;

int main()

{ char ch;

int x,y;

while (ch!=β€˜x’ or ch!=β€˜X’) {

cin >> ch;

switch(ch) {

case β€˜+’: { cin >> x; cin >> y;
cout << x+y << endl;
break; }

case β€˜-’: { cin >> x; cin >> y;
cout << x-y << endl;
break; }

case '’: { cin >> x; cin >> y;
cout << x
y << endl;
break; }

case β€˜/’: { cin >> x; cin >> y;
cout << x/y << endl;
break; }

default : { cout << β€œInvalid operation. Try again.” << endl;
continue;
}

}

}

return 0;
}

hello @sid_kapoor
pls share ur code using cb ide.

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.