Palindrome Number.

Program to check whether a given number is Palindrome or not.


A palindromic number or numeral palindrome is a number that remains the same when its digits are reversed. Like 16461, for example, it is "symmetrical".







SOURCE CODE


import java.io.*;
public class Palindrome
{
    public static void main(String args[])throws IOException
    {
        BufferedReader br=new BufferedReader (new InputStreamReader(System.in));
        System.out.print("Enter a number    :");
        int a=Integer.parseInt(br.readLine());
        int rem,palen=0,n;
        n=a;
        while(n>0)
        {
            rem=n%10;
            palen=palen*10+rem;
            n=n/10;
        }
        if(palen==a)
        {
              System.out.println("Yes,It is a palendrome No.");
        }
        else
        {
            System.out.println("No,It is not a palendrome No.");
        }
    }
}


Click here to Download.


OUTPUT


                           



If you have any question then leave a comment below I will do my best to answer that question.


Comments

Popular posts from this blog

[Question 3] ISC 2017 Computer Practical Paper Solved – Caesar Cipher.

Pattern of your own name.

Designing Patterns - Print 'Z'.