import java.util.Scanner ;
public class calculator {
public static void main(String args[]) {
takeInput();
}
public static void takeInput(){
Scanner s = new Scanner(System.in);
char ch = s.next().charAt(0);
if (ch == 'X' || ch == 'x'){
return ;
}
else if (ch == '+'){
int a = s.nextInt();
int b = s.nextInt();
System.out.println(a+b);
}
else if (ch == '-'){
int a = s.nextInt();
int b = s.nextInt();
System.out.println(a-b);
}
else if (ch == '*'){
int a = s.nextInt();
int b = s.nextInt();
System.out.println(a*b);
}
else if (ch == '/'){
int a = s.nextInt();
int b = s.nextInt();
System.out.println(a/b);
}
else if (ch == '%'){
int a = s.nextInt();
int b = s.nextInt();
System.out.println(a%b);
}
else{
System.out.println("Invalid operation. Try again.");
takeInput();
}
}
}
the code is working fine on eclipse for all the test cases , then why it is showing an error while submitting the code ?