How to reverse a string using a recursive function, without
swapping or using an extra memory?

Answer Posted / mahendra aseri

Using recursive Function:

void rev_str(char *str)
{
if(*str!=NULL)

rev_str(str+1);

printf("%c",str);
}

Is This Answer Correct ?    20 Yes 43 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how to write optimum code to divide a 50 digit number with a 25 digit number??

2967


Is c is a high level language?

838


Why array is used in c?

750


Write a program to print all permutations of a given string.

916


Explain the use of 'auto' keyword

870


How do you define CONSTANT in C?

868


What are the 32 keywords in c?

840


What is the function of multilevel pointer in c?

830


Why main is not a keyword in c?

880


a c code by using memory allocation for add ,multiply of sprase matrixes

2514


What are external variables in c?

766


Is there sort function in c?

780


Whats s or c mean?

766


What should malloc() do? Return a null pointer or a pointer to 0 bytes?

807


How can I display a percentage-done indication that updates itself in place, or show one of those twirling baton progress indicators?

779