Page 108 - IP
P. 108

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {

               int a,b,c=0;


                       a=Integer.parseInt(jTextField1.getText());


                       int d=a;

                       while(a>0)


                       {

                           b=a%10;


                           a=a/10;

                           c=c*10+b;


                       }


                       if(c==d)

                           System.out.print("YES");


                       else

                           System.out.print("NO");


               }

               Q17. To check if a string is Palindrome.
   103   104   105   106   107   108   109   110   111   112   113