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

Answer Posted / aravind

#Include<stdio.h>
void display(char*)
void main()
{
char str[]= "Aravind"
disply(str)
}
void display(char *p)
{
static int i=1;
if(*p=='\0')
{
display(p+i)
i++
}
printf("%c",*p)
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why c is called object oriented language?

851


Explain about the functions strcat() and strcmp()?

819


Write a program which returns the first non repetitive character in the string?

875


Between macros and functions,which is better to use and why?

1848


What are directives in c?

777


how many errors in c explain deply

1877


write a c programming using command line argument,demonstrate set operation(eg;union,intersection,difference) example output is c:>setop 12 34 45 1 union 34 42 66 c:>setop 12 34 1 42 66 c:>setop 12 34 diff 12 56 67 78 setop 12 34

1904


Why do we write return 0 in c?

816


How does struct work in c?

854


Is calloc better than malloc?

821


code for quick sort?

1851


How can you find the day of the week given the date?

896


Is flag a keyword in c?

963


What is structure padding in c?

869


Differentiate between the expression “++a” and “a++”?

1026