Page 390 - computer science (868) class 11
P. 390

15               {

                16                   rev=rev*10+i%10;
                17                   return revnum(i/10); // recursive case

                18               }
                19           }

                20           void check()
                21           {
                22               if(revnum(num)==num)// if number = its reverse

                23                   System.out.println(num + " is a Palindrome Number"); //display

                24               else
                25                   System.out.println(num + " is not a Palindrome Number");
                26           }

                27           public static void main(int x)
                28           {

                29               Palindrome obj = new Palindrome(x);
                30               obj.check();

                31           }
                32       }

              The output of the preceding program is as follows:
















              121 is a Palindrome Number















              65 is not a Palindrome Number






                388388  Touchpad Computer Science-XI
   385   386   387   388   389   390   391   392   393   394   395