To Find the Palandrum Number using Java

To Find the Palandrum Number using Java

import java.util.*;
public class PalandrumNum {
  public static void main(String args[])
  {
      Scanner s=new Scanner(System.in);
    int n,r,d=0,temp;
    System.out.println(“enter a number”);
    n=s.nextInt();
    temp=n;
    while(n!=0)
    {
        r=n%10;
        d=d*10+r;
        n=n/10;
        
    }
    if(temp==d)
        System.out.println(“palandrum”);
    else
        System.out.println(“not palandrum”);
  }
    
  
}

One thought on “To Find the Palandrum Number using Java

  • July 25, 2016 at 7:42 pm
    Permalink

    Greetings. I am a young Border Patrol Agent and was wishing to better be prepared for my position at The Walt Disney Company. This is the reason why I came to your blogs. Being grown in Graham and on the way to school at Loyola University Maryland (MD) in Summerdale, has helped me to get ready for my destiny. My mom and dad were also teachers and they explained me about this guide after studying The Little Big School. Regards

Leave a Reply