Sir
What is the fault in this program??
import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner obj = new Scanner(System.in);
while(true){
char ch = obj.next().charAt(0);
if(ch=='+' || ch=='-' || ch=='*' || ch=='/' || ch=='%'){
int n1 = obj.nextInt();
int n2 = obj.nextInt();
if(n1>0 && n1<100000000){
if(n2>0 && n2<100000000){
int res = 0;
switch(ch){
case '+':
res = n1+n2;
break;
case '-':
res = n1-n2;
break;
case '*':
res = n1*n2;
break;
case '/':
res = n1/n2;
break;
case '%':
res = n1%n2;
break;
}
System.out.println(res);
System.exit(0);
}
}
}else if(ch=='x' || ch=='X'){
System.exit(0);
}else{
System.out.println("Invalid operation. Try again.");
}
}
}
}