Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Palidrome
- {
- public static void main(String args[])
- {
- Scanner s = new Scanner(System.in);
- System.out.print("Enter Number = ");
- int no= s.nextInt();
- int rev=0,x,y=no;
- while(no>0)
- {
- x=no%10;
- rev=(rev*10)+x;
- no=no/10;
- }
- if(rev == y)
- {
- System.out.print("Number is Palidrome");
- }
- else
- {
- System.out.print("Number is not Palidrome");
- }
- }
- }
Add Comment
Please, Sign In to add comment