Compile error in scanner class

import java.util.Scanner;

public class REVERSE {
public static void main(String[] args) {
Scanner scn=new Scanner(System.in);
System.out.println(“ENTER THE NUMBER”);
int n=scn.nextInt();
int r=0;
int a;
while(n%10!=0)
{
a=n%10;
r=r*10+a;
n=n/10;
}
System.out.println("THE NUMBER is "+r);
}
}

your code is working fine. I just checked it in another IDE. you might not be providing input in advance. try to provide input before executing the code.
Thanks.

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.