Basic calculator

import java.util.*;
public class Main {
public static void main(String args[]) {
// Your Code Here
Scanner sc=new Scanner(System.in);
char ch;
int ans=0;
do{

			ch=sc.next().charAt(0);
			
			while(ch!='+'&&ch!='-'&&ch!='*'&&ch!='/'&&ch!='%' && ch!='x'&& ch!='X'){
				System.out.println("Invalid operation. Try again");

ch=sc.next().charAt(0);
}
if(ch==‘x’||ch==‘X’){
break;
}
int N1=sc.nextInt();
int N2=sc.nextInt();
if(ch==’+’){
ans=N1+N2;
System.out.println(ans);
}
else if(ch==’-’){
ans=N1-N2;
System.out.println(ans);
}
else if(ch==’’){
ans=N1
N2;
System.out.println(ans);
}
else if(ch==’%’){
if(N2!=0){
ans=N1%N2;
System.out.println(ans);
}
else{
return;
}
}
else if(ch==’/’){
if(N2!=0){
ans=N1/N2;
System.out.println(ans);
}
}

		}
			while(ch!='x'&&ch!='X');

			
		
		
	}

} while compiling iam getting same output but when i submit it test cases are failed

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.