Breaking News

Program to calculate string palindrome in c

#include "stdio.h"
#include"string.h"
main()
{
char x[100],y[100];
printf("Enter a string :");
scanf("%s",x);
strcpy(y,x);
check_palindrome(x);
if(strcmp(x,y)==0)
printf("Palindrome");
else
printf("Not Palindrome");
}
int check_palindrome(char *x)
{
int len=strlen(x);
int i;
char temp;
for(i=0;i{
temp=x[i];
x[i]=x[len-i-1];
x[len-i-1]=temp;
}
}

No comments