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

State the difference between realloc and free.

1101


WHICH TYPE OF JOBS WE GET BY WRITING GROUPS .WHEN THE EXAMS CONDUCTED IS THIS EXAMS ARE CONDUCTED EVERY YEAR OR NOT.PLS TELL ME THE ANSWER

1868


What is the difference between exit() and _exit() function in c?

1083


How can you find out how much memory is available?

1074


What is hungarian notation? Is it worthwhile?

1233


What happens if you free a pointer twice?

1091


What is floating point constants?

1147


What are disadvantages of C language.

1168


Why is C language being considered a middle level language?

1137


Why is main function so important?

1113


what is the differnce between programing langauge and tool? is sas is a programing langauge r tool?

2398


Are pointers integer?

1025


What are near, far and huge pointers?

1064


What is the purpose of macro in C language?

1127


Explain the use of keyword 'register' with respect to variables.

1063