Given String is palindrome or Not.



# include
# include
# include
void main(void)
{
clrscr();
char st[20];
int i,l,s,mid;
printf(" Enter the string \n");
gets(st);
l=strlen(st);
mid=l/2;
for(i=0;i<=mid;i++)
if (st[i]!=st[l-1])
goto XX;
else
l=l-1;
printf("the given string is palindrome \n");
goto YY;
XX:
printf("The given string is not palindrome\n");
YY:;
getch();
}



No comments:

Post a Comment