write a C code
to reverse a string using a recursive function, without
swapping or using an extra memory.

Answer Posted / valli

void reverse(char s[],int len)
{
putchar(s[len]);
len--;
if(len>=0)
reverse(s,len);

return;
}

Is This Answer Correct ?    49 Yes 33 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What Is The Difference Between Null And Void Pointer?

648


Explain the use of 'auto' keyword

681


#include { printf("Hello"); } how compile time affects when we add additional header file .

1428


What is d scanf?

599


main use of recursive function a) processing speed high b) reduce program length/reduce repeated statements c) if you do not, use iterative methods like, for, while or do-while d) all the above

617






What is restrict keyword in c?

647


Explain what is a static function?

634


Did c have any year 2000 problems?

660


What is signed and unsigned?

646


What are variables c?

624


Explain what is #line used for?

610


An application package has been provided to you without any documents for the following application. The application needs to be tested. How will you proceed?

675


What do you mean by invalid pointer arithmetic?

637


Differentiate between #include<...> and #include '...'

621


What standard functions are available to manipulate strings?

567