Basic calculator program TLE error

#include

using namespace std;

int main() {
int n1, n2,n3;
char ch;

while(ch != 'x' || ch != 'X'){
    cin >> n1;
    cin >> n2 ;
    if(ch == '+'){
        n3 = n1 +n2 ;

    }
    else if(ch == '-'){
        n3 = n1 - n2;
    }
    else  if(ch == '*'){
        n3 = n1 * n2;

    }
    else if(ch == '%'){
        if (n2 == 0){
            break;
        }
        else {
            n3 = n1%n2 ;
        }
    }
    else if(ch == '/'){
        if( n2 == 0){
            break ;
        }
        else{
            n3 = n1/n2;
        }
    }
    else{
        cout << "Invalid operation. Try again."<< endl;
    }


    cout << n3  << endl ;
    cin >> ch ;
}

}

(where is the issue in this code .)

I corrected your mistakes you can check in the below code…
Modified code:

better is to use the switch cases rather then using if-else…

i hope this help, if you have further doubt,
feel free to ask

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.