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 is malloc calloc and realloc in c?

1338


What is the difference between c &c++?

1159


Differentiate between functions getch() and getche().

1054


What is clrscr in c?

1137


Explain the properties of union. What is the size of a union variable

1190


Why doesnt this code work?

1069


Is c programming hard?

1034


How can I get the current date or time of day in a c program?

1228


What is a example of a variable?

1026


Ow can I insert or delete a line (or record) in the middle of a file?

1005


Explain what math functions are available for integers? For floating point?

1117


Why is c used in embedded systems?

1124


What is array of structure in c?

1186


What is the maximum length of an identifier?

1188


What is main () in c?

1078