Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Answer Posted / vinay tiwari

void reverse(char *,int b);
void main()
{
char a[26];
int len;
clrscr();
printf("enter string ");
gets(a);
len=strlen(a);
reverse(a,len);
getch();
}
void reverse(char * a,int len)
{
if(len==0)
printf("%c",a[len]);
else
{
printf("%c",a[len]);
reverse(a,len-1);
}
}

Is This Answer Correct ?    177 Yes 62 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

c language interview questions & answer

1965


what is event driven software and what is procedural driven software?

2585


What language is lisp written in?

1271


What is meant by int main ()?

1213


How to declare pointer variables?

1248


What is the difference between class and object in c?

1180


Explain the difference between malloc() and calloc() in c?

1054


Did c have any year 2000 problems?

1112


What is hashing in c?

1165


What are the application of c?

1102


why use "return" statement a) on executing the return statement it immediately transfers the control back to the calling program b) it returns the value present in the parentheses return, to the calling program c) a & b d) none of the above

1085


Can you please explain the difference between malloc() and calloc() function?

1127


What is function definition in c?

1079


any "C" function by default returns an a) int value b) float value c) char value d) a & b

1087


How do you determine the length of a string value that was stored in a variable?

1126