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, with
swapping?

Answer Posted / nitin

#include<stdio.h>
#include<conio.h>
#include<string.h>
char * reverse (char *);
void main()
{
char p[90],*k;

gets(p);
clrscr();
k=reverse(p);
puts(k);
getch();
}
char * reverse(char *p)
{
char *k="";


if (*p==NULL )
{
return("");
}
else
{
k=reverse(p+1);
}
k[strlen(k)]=*p ;
k[strlen(k)+1]=NULL;
return k;
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the general description for loop statement and available loop types in c?

1088


How do I convert a string to all upper or lower case?

1075


What is the best way to store flag values in a program?

1030


How do you do dynamic memory allocation in C applications?

1065


what is diffrence between linear and binary search in array respect to operators?what kind of operator can be used in both seach methods?

1821


What is the -> in c?

970


The % symbol has a special use in a printf statement. Explain how would you place this character as part of the output on the screen?

1168


Explain what is the purpose of "extern" keyword in a function declaration?

1044


Tell us two differences between new () and malloc ()?

1143


How does selection sort work in c?

1000


Explain #pragma statements.

998


What does node * mean?

1158


What is the newline escape sequence?

1041


What is string function c?

987


Is malloc memset faster than calloc?

1030