# 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.