theme

" जीतने वाले छोड़ते नहीं और छोड़ने वाले जीतते नही "

Monday, May 28, 2012

palindrome program in c/c++


#include
#include
#include
void main()
{
char st[10];
int l=0,i,j,flag=0;
clrscr();
cout<<"enter the number";
cin>>st;
l=strlen(st);
for(i=0,j=l-1;i<=(l+1)/2;i++,j--)
{
if(st[i]==st[j])
flag=1;
}
if(flag==1)
cout<<"palindram";
else
cout<<"not palindram";


getch();
}