Thursday, July 30, 2009

How can i create a palindrome program in c++ by just using array?

i just really need it for my project. i don't know how to do it using array. i made it by reversing the string but my professor told me that i should use an array. thanks in advance.. :)

How can i create a palindrome program in c++ by just using array?
just givin' the code


char c[50];


int l=strlen(c);


int flag


for (i=0;i%26lt;l;i++)


{if (c[i]==c(l-i-1))


flag=1;


else flag =0;


if (flag==0)


break;}


No comments:

Post a Comment