Advertisement
shawonrog

Palindrome

Feb 19th, 2018
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. package basicjavalipu1;
  2. import java.util.Scanner;
  3. class BasicJavaLipu1{
  4. public static void main(String args[]){
  5. Scanner in = new Scanner(System.in);
  6. int r,sum=0,temp;
  7. int n=in.nextInt();
  8.  
  9. temp=n;
  10. while(n>0){
  11. r=n%10;
  12. sum=(sum*10)+r;
  13. n=n/10;
  14. }
  15. if(temp==sum)
  16. System.out.println("palindrome number ");
  17. else
  18. System.out.println("not palindrome");
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement