Guest User

Untitled

a guest
Jul 21st, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Palidrome
  4. {
  5. public static void main(String args[])
  6. {
  7. Scanner s = new Scanner(System.in);
  8. System.out.print("Enter Number = ");
  9. int no= s.nextInt();
  10. int rev=0,x,y=no;
  11.  
  12. while(no>0)
  13. {
  14. x=no%10;
  15. rev=(rev*10)+x;
  16. no=no/10;
  17. }
  18. if(rev == y)
  19. {
  20. System.out.print("Number is Palidrome");
  21. }
  22. else
  23. {
  24. System.out.print("Number is not Palidrome");
  25. }
  26. }
  27. }
Add Comment
Please, Sign In to add comment