#include<stdio.h>
#include<conio.h>
#include<string.h>
# define SIZE 26
void main()
{
char s[SIZE];
int flag=0,i,j,l;
clrscr();
printf("\n enter the string\n\t");
gets(s);
l=strlen(s);
for
(i=0,j=l-1;s[i]!='\0';i++,j--)
{
if(s[i]!=s[j])
{
flag=1;
break;
}
}
if(flag==0)
printf("\n given string is palindrom");
else
printf("\n given string is not palindrom");
getch();
}
thanks for posting this program it is awesome
ReplyDelete#include
ReplyDelete#include
#include
# define SIZE 26
void main()
{
char s[SIZE];
int flag=0,i,j,l;
clrscr();
printf("\n enter the string\n\t");
gets(s);
l=strlen(s);
for
(i=0,j=l-1;s[i]!='\0';i++,j--)
{
if(s[i]!=s[j])
{
flag=1;
break;
}
}
if(flag==0)
printf("\n given string is palindrom");
else
printf("\n given string is not palindrom");
getch();
}