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...

write a C code
to reverse a string using a recursive function, without
swapping or using an extra memory.

Answer Posted / billy

string reverse with out recursion


void rev( char *p )
{

char tmp;
int len =strlen(p)-1;
for( int i=0 ; i <= len/2 ; i++ )
{


tmp = p[i] ;
p[i] = p[len - i ] ;
p[len - i ] = tmp ;
}


printf("%s",p);


}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are multidimensional arrays?

1119


What will be the outcome of the following conditional statement if the value of variable s is 10?

1284


Explain the difference between exit() and _exit() function?

1167


Do you know the purpose of 'register' keyword?

1019


Is it cc or c in a letter?

1021


How can I determine whether a machines byte order is big-endian or little-endian?

1055


What is wild pointer in c with example?

1057


What is the difference between malloc() and calloc()?

1845


What does the function toupper() do?

1123


How macro execution is faster than function ?

1183


Explain can the sizeof operator be used to tell the size of an array passed to a function?

1068


What is chain pointer in c?

1058


What is strcmp in c?

1118


Is null a keyword in c?

1194


What is merge sort in c?

1046