hi
can anyone help me out of this program
/*program to determine a palindrome*/
#include<stdio.h>
#include<conio.h>
#include<string.h>
int main()
{
int check(char *start);
char word[40];
int result;
printf("\nEnter the string\t");
scanf("%s",word);
result=check(word);
if(result==1)
printf("\n%s is a palindrome\n",word);
else
printf("\n%s is not a palindrome\n",word);
getche();
return 0;
}
int check(char *start)
{
char *end;
int i,len=0;
while(*start!='\0')
{
len++;
*start++;
}
start=start-len;
end=start+len;
for(i=0;i<len/2;i++)
{
if(*start==*end)
{
*start++;
*end--;
return 1;
}
else
return 0;
}
}



LinkBack URL
About LinkBacks


