Computer Science, asked by legendwarrior02, 3 months ago

Write a program to check a string whether it is palindrome or not.

Answers

Answered by trishitaaf
1

Answer:

int main()

{

    char s[1000];  

    int i,n,c=0;

    printf("Enter  the string : ");

    gets(s);

    n=strlen(s);

    for(i=0;i<n/2;i++)  

    {

     if(s[i]==s[n-i-1])

     c++;

}

if(c==i)

    printf("string is palindrome");

    else

      printf("string is not palindrome");

   return 0;

}

Similar questions