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 / mahesh auti

#include <stdio.h>
#include <conio.h>
#include <string.h>
int main(void)
{

char str1[] = "Mahesh";
char str2[80], *p1, *p2;

clrscr();

p1 = str1 + strlen(str1) - 1;

p2 = str2;

while(p1 >= str1)
*p2++ = *p1--;

*p2 = '\0';

printf("%s %s", str1, str2);

getch();

return 0;
}

Is This Answer Correct ?    26 Yes 25 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a program to check palindrome number in c programming?

1009


Can we access array using pointer in c language?

1082


What is the acronym for ansi?

1043


Explain what is the difference between #include and #include 'file' ?

1018


What is logical error?

1114


Is a house a shell structure?

1158


What is c standard library?

1197


What is main () in c language?

1128


Input is "rama loves rajesh and rajesh Loves rama also and rajesh wear gloves and bloves" To print output is count the numbers of times repeted the word love without case sensitive.

2051


What is Dynamic memory allocation in C? Name the dynamic allocation functions.

1405


What does & mean in scanf?

1102


Is c procedural or functional?

1021


What are enums in c?

1195


What is the difference between far and near ?

1189


How can I manipulate strings of multibyte characters?

1107