Basic Calculator

#include
#include<math.h>
using namespace std;
void operation(char);
int main() {
char ch;

do
{
	cin>>ch;
	if(ch=='+'||ch=='-'||ch=='*'||ch=='/'||ch=='%')
    operation(ch);
	
	else{
	cout<<"Invalid operation. Try again."<<endl;
	
	continue;
	}
}while(ch!='X'||ch!='x');
return 0;

}
void operation(char ch)
{
int N1,N2,ans=0;
cin>>N1>>N2;
switch(ch)
{
case ‘+’: ans=N1+N2;

		          break;
        case '-': ans=N1-N2;
		         
		          break;
	    case '*': ans=N1*N2;
		          
		          break;
		case '%': ans=N1%N2;
		          break;
		         
		         
	}
	cout<<ans<<endl;
}

//My code is showing TLE . Unable to find another logic.

@rakesh_anand share your code using cb ide

how to share code using cb ide?

@rakesh_anand


paste here save and then send the link here