Thursday, July 30, 2009

What is the code for displaying reverse of a string using recursive function in C?

In C.

What is the code for displaying reverse of a string using recursive function in C?
printrestofstringbackwards()


{


if (last letter)


{


print letter


}


else


printrestofstringbackwards()


}








there's some psuedocode...have fun. see how you print something backwards is you print the rest of the word backwards then you print the first letter. and how you print the remainder backwards is you print the rest of it backwards, then the first letter...and so on until no word is left.
Reply:You only need to ask once. Reported as spam.


No comments:

Post a Comment