String Palindrome program in C language

C Program to check whether the string input by the user is palindrome or not. Palindrome is the word, phrase or sequence which reads the same backwards as the original.

#include <stdio.h>

#include<string.h>

int main() {

char str[100],str1[100];
int count=0,i=0,j,n;
printf("enter string");
gets(str);
n=strlen(str);

for(i=0; str[i]!='\0'; ++i){
j=n-i-1;
str1[j]=str[i];

}

if(strcmp(str,str1)==0)
printf("yes palindrom");
else
printf("no");

return 0;
}



 

OutputĀ