fork download
  1. import java.io.*;
  2. public class reverse
  3. {
  4. public static void main (String args[])
  5. {
  6. int n=0,rev=0,rem=0;
  7. try
  8. {
  9. System.out.println("Enter number:");
  10. n=Integer.parseInt(d.readLine());
  11. }
  12. catch(Exception f)
  13. {}
  14. while (n>0)
  15. {
  16. rem=n%10;
  17. rev=rev*10+rem;
  18. n=n/10;
  19. }
  20. System.out.println("\n\t Rev No="+rev);
  21. }
  22. }
  23.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:2: error: class reverse is public, should be declared in a file named reverse.java
public class reverse
       ^
Main.java:10: error: cannot find symbol
    BufferedReader d= new BufferedReader(new InputStreamReader(in));
                                                               ^
  symbol:   variable in
  location: class reverse
2 errors
stdout
Standard output is empty