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 is meant by preprocessor in c?

948


What is your stream meaning?

1127


Why do we use main function?

1112


How can a program be made to print the line number where an error occurs?

1036


How can I open a file so that other programs can update it at the same time?

1132


Write a program to print "hello world" without using a semicolon?

1004


When should a type cast be used?

965


Using which language Test cases are added in .ptu file of RTRT unit testing???

4217


Do you have any idea how to compare array with pointer in c?

991


What is ambagious result in C? explain with an example.

2551


What does & mean in scanf?

1043


What is the general form of function in c?

975


What does the && operator do in a program code?

1159


Is it cc or c in a letter?

960


How do you define structure?

993