HOME

Friday, March 20, 2015

C PROGRAM TO CHECK WEATHER THE GIVEN STRING IS PALINDROME OR NOT

#include<stdio.h>
#include<conio.h>
void main()
{
    char word[10],word1[10];
    printf("enter the string\n");
    gets(word);
    strcpy(word1,word);
    if(strcmp(strrev(word),word1)==0)
    {
        printf("%s  is palindrome\n",word1);
            }
            else
            {
     printf("%s is not palindrome\n",word1);
  }
getch();
}

No comments:

Post a Comment