Baisc calculator problem it is showing error that " aborting command ,singnal 5 "

here is my code

using namespace std;

int main()
{
char ch;
cin>>ch;
do{

    if(ch=='+')
    {
        long long int n1,n2,n3;
     cin>>n1>>n2;
        n3=n1+n2;
        cout<<n3;
    }
    else if(ch=='-')
    {
        long long int n1,n2,n3;
     cin>>n1>>n2;
        n3=n1-n2;
        cout<<n3;

    }
    else if(ch=='*')
    {
     long long int n1,n2,n3;
     cin>>n1>>n2;
        n3=n1*n2;
        cout<<n3;

    }
    else if(ch=='/')
    {
        long long int n1,n2,n3;
     cin>>n1>>n2;
        if(n2==0)

           {


           break;}
        else
        {
           n3=n1/n2 ;
           cout<<n3;
        }

    }
    else if(ch=='%')
    {
        long long int n1,n2,n3;
        cin>>n1>>n2;
        if(n2==0)

           {


           break;}
        else
        {
           n3=n1%n2;
           cout<<n3;
        }

    }


    else
   {
     cout<<"Invalid operation. Try again.";
   }
}while(ch!='x'||ch!='X') ;

return 0;
}

have debugged your code here -> https://ide.codingblocks.com/s/376835
Have a look.

what is the problem in the code as when i was submitting in challenge box ,so compilation was not occuring

You were taking ch only one time, we have to take it 2 times one outside the loop and other inside the loop so if ch = x we come out from the loop.

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.