Doubt in basic calculator, I cannot understand why all test cases are not passed

this is the code

import java.util.;
public class Main {
public static void main(String args[]) {
Scanner sc=new Scanner(System.in);
while(true)
{
char ch=sc.next().charAt(0);
if(ch==’+’ || ch==’-’ || ch==’
’ || ch==’/’)
{
double n1=sc.nextDouble();
double n2=sc.nextDouble();
if(ch==’+’)
{
System.out.println(n1+n2);
}
else if(ch==’-’)
{
System.out.println(n1-n2);
}
else if(ch==’’)
{
System.out.println(n1
n2);
}
else
{
System.out.println(n1/n2);
}
}
else if(ch==‘x’ || ch==‘X’)
{
break;
}
else
{
System.out.println(“Invalid operation.Try Again”);
}
}
}
}

Change the input from double to long

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.