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
Why void is used in c?
what is the difference between north western polytechnique university and your applied colleges?? please give ur answers for this. :)
What is difference between %d and %i in c?
What is the difference between printf and scanf )?
Whats s or c mean?
Are the outer parentheses in return statements really optional?
What's the difference between constant char *p and char * constant p?
What are runtime error?
What do you mean by recursion in c?
Is array name a pointer?
Explain what’s a signal? Explain what do I use signals for?
Why double pointer is used in c?
Write a program to replace n bits from the position p of the bit representation of an inputted character x with the one's complement. Method invertBit takes 3 parameters x as input character, p as position and n as the number of positions from p. Replace n bits from pth position in 8 bit character x. Then return the characters by inverting the bits.
Explain how do you sort filenames in a directory?
Is the exit() function same as the return statement? Explain.