Basic Calculator java progeram

import java.util.Scanner;
public class main{
static Scanner scn=new Scanner(System.in);
public static void main(String[] args) {
char ch;
do {
ch = scn.next().charAt(0); // Use cin in case of c++
if (ch == β€˜+’ || ch == β€˜-’ || ch == ’ * ’ || ch == β€˜/’ || ch == β€˜%’) {
operation(ch);
} else {
if (ch != β€˜x’ && ch != β€˜X’)
System.out.println(β€œInvalid operation. Try again.”);
}
} while (ch != β€˜x’ && ch != β€˜X’);
}
public static void operation(char ch) {
int a = scn.nextInt(); // Use cin in case of c++
int b = scn.nextInt(); // Use cin in case of c++
int res = 0;
switch (ch) {
case β€˜+’: {
res = a + b;
break;
}
case β€˜-’: {
res = a - b;
break;
}
case β€˜*’: {
res = a * b;
break;
}
case β€˜/’: {
res = a / b;
break;
}
case β€˜%’: {
res = a % b;
break;
}
}
System.out.println(res);
}
}

pls chexck my code so many errors

There are so many errors in your code. Firstly, you are using inverted commas of the wrong format. This could be because you are coding in an inappropriate text editor. Try using either online ide, or eclipse or intellij for the same. The other compile time errors are being generated because of extra closing or opening parenthesis in your program. Please remove them and post your code again.

how to remove ,don’t options

I think all of these errors are pretty basic compiler time errors, if you use a decent IDE like Eclipse or Intellij, it will flag them out while writing itself.

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.