C Program to check whether the given string is Palindrome or not


SOURCE CODE:
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
 char str1[20],str2[20];
 int i;
 clrscr();
 printf("\nEnter the string....");

scanf("%s",str1);
 strcpy(str2,str1);
 strrev(str2);
 i=strcmp(str1,str2);
  if(i==0)
   {
    printf("%s is PALINDROME",str1);
   }
  else
   {
    printf("%s is NOT PALINDROME",str1);
   }
 getch();
}
Previous
Next Post »

Still not found what you are looking for? Try again here.