+ 1
How to display a largest palindrome from a string..
i am giving an example.. Ex- user entered a string "racemammacar" here in this example we have two plaindromes 'mam' and 'amma' now we have to find those palindrome and print the longest of the two....plz help me..
2 Answers
+ 1
First go through your array of chars and test whether char[i-1] and char[I+1] are equal when they are try i-2 and i+2. When not store it in a string array or string vector. After you are completely through the input array go through your result array created in the description above. And search for the longest result. At the end print longest result.
+ 1
can you provide me with the code