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

What is a volatile keyword in c?

1112


Why we use stdio h in c?

983


What is I ++ in c programming?

1059


Write a c program to demonstrate character and string constants?

2114


What is non linear data structure in c?

967


Why clrscr is used after variable declaration?

1622


What is the scope of an external variable in c?

982


Explain what is a pragma?

993


Explain the process of converting a Tree into a Binary Tree.

2607


What is typedef example?

1111


What are keywords c?

983


How can I change the size of the dynamically allocated array?

1092


what is the diffrenet bettwen HTTP and internet protocol

1785


What are the different properties of variable number of arguments?

1102


What does a pointer variable always consist of?

1041