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

What is a spanning Tree?

941


What is the use of bit field?

628


Explain function?

654


There is a practice in coding to keep some code blocks in comment symbols than delete it when debugging. How this affect when debugging?

808


Explain the properties of union.

604






How do I use void main?

621


Are enumerations really portable?

588


Did c have any year 2000 problems?

647


The number of bytes of storage occupied by short, int and long are a) 2, 2 and 4 b) 2, 4 and 4 c) 4, 4 and 4 d) none

755


What are the types of pointers?

595


What is the difference between fread and fwrite function?

629


Why is c not oop?

533


How do you use a pointer to a function?

621


How can I sort more data than will fit in memory?

619


What is data types?

628