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 / aditi parab

#include <stdio.h>
int main ()
{
int i,j;
char a[10];
char temp;
//clrscr (); // only works on windows
gets(a);
for (i=0;a[i]!='\0';i++);
i--;
for (j=0;j <= i/2 ;j++)
{
temp = a[j];
a[j] = a[i-j];
a[i-j] = temp;
}
printf("%s",a);
return(0);
}

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is different between auto and local static? why should we use local static?

1077


can any one please explain, how can i access hard disk(physical address)? it is possible by the use of far,near or huge pointer? if yes then please explain......

1808


What is an operator?

1018


Find MAXIMUM of three distinct integers using a single C statement

1013


Is that possible to add pointers to each other?

1318


What functions are used in dynamic memory allocation in c?

1017


What is the use of bit field?

1116


What is substring in c?

1132


What is the advantage of a random access file?

1129


How do you list files in a directory?

1075


Can you explain what keyboard debouncing is, and where and why we us it? please give some examples

2144


Explain how can you restore a redirected standard stream?

1029


List out few of the applications that make use of Multilinked Structures?

2109


What is || operator and how does it function in a program?

1041


How do you write a program which produces its own source code as output?

1060