Monday, May 24, 2010

C++ program that write a function that determines if a string is a palindrome with a loop in a function?

I dont know how to write this program. Can someone help?

C++ program that write a function that determines if a string is a palindrome with a loop in a function?
I ll just give u the logic. if i write, then u cant improve.





step 1 :- take the given string and put it in a character array.


step 2: - run a for loop, starting from length(last letter) of array till u reach first character.


step 3:- store each and every character in another array.


step 4:- come out of loop after reaching the end. check whether both char array are same. if so its palindrome or else its not.


No comments:

Post a Comment