/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package girmmaproject;

import java.util.Scanner;

public class Q17  {
      public static void main(String [] args){
      try{
      Scanner input = new Scanner(System.in);
      System.out.println("Enter number");
      int num= input.nextInt();
        int n = num;
        int rev=0;
        System.out.println("Number: ");
        System.out.println(" "+ num);
        for (int i=0; i<=num; i++){
          int r=num%10;
          num=num/10;
          rev=rev*10+r;
          i=0;
        }
        System.out.println("After reversing the number: "+ " ");
        System.out.println(" "+ rev);
        if(n == rev){
        System.out.print("Number is palindrome!");
        }
        else{
        System.out.println("Number is not palindrome!");
        }
      }
      catch(Exception e){
        System.out.println("Out of range!");
      }
  }
}