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

What language is c written?

762


When can you use a pointer with a function?

765


What is time null in c?

771


Which is an example of a structural homology?

1058


What is equivalent to ++i+++j?

868


Write a program to check whether a number is prime or not using c?

822


What is the difference between near, far and huge pointers?

835


please send me the code for multiplying sparse matrix using c

1946


What is preprocessor with example?

795


Can static variables be declared in a header file?

833


What is the difference between class and object in c?

832


Difference between linking and loading?

903


how logic is used

1728


Can we assign string to char pointer?

824


Explain what is the benefit of using an enum rather than a #define constant?

1000