Java, .NET, PHP, PYTHON, ANGULAR, .NET, ML, Data Scince, Testing, CI Tutorials in Easy Languages.

"Best Software Training, Internship, Project Development center of Indore India, Helpline 780506-3968"

Palindrome Program in Java 

Pallindorm means from left to right and right to left string should be matched.

Pallindorm can be an integer as well as a string both.

This program is used to check palindrome using String.

class Checkpallindrom
{

     public static void main(String args[])
     {
          char arr[] = {'m','a','d','a','n'};
          int i,j;
          boolean flag=true;
          for(i=0,j=arr.length-1;i<arr.length/2;i++,j--)
          {
                if(arr[i]!=arr[j])
                {
                    flag=false;
                    System.out.println("Not Pallindrom");
                    break;

                }

          }
         if(flag)
         System.out.println("Pallindrom");


     }


}



Post a Comment

If you have any doubt in programming or join online classes then you can contact us by comment .

Previous Post Next Post