Basic Calculator

#include
using namespace std;

int main()
{
char ch;
cin >> ch;
do{
if(ch==’+’ && ch==’-’ && ch==’*’ && ch==’/’ && ch==’%’)
{
long int num1, num2;
cin >> num1 >> num2;

		switch(ch)
		{
    		case '+':
        		cout << num1+num2<<endl;
        		break;

    		case '-':
        		cout << num1-num2<<endl;
        		break;

   		 	case '*':
        		cout << num1*num2<<endl;
        		break;

    		case '/':
        		cout << num1/num2<<endl;
        		break;

    		default:
        		cout << "Invalid operation. Try again."<<endl;
        		break;
		}	
	}
	else
	cout<<"Invalid operation. Try again. "<<endl;
}
while(ch!='X' && ch!='x');

}

Modified Code

i have remove all your errors
take a look at modified Code and feel free to ask doubt if any

Thank you so much !!

plz mark your doubt as resolved

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.