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 / vignesh1988i

my next logic:::

#include<stdio.h>
#include<conio.h>
void reverse(char*,char*);
void main()
{
char a1[50],*p;
int count=0;
printf("enter the string:");
scanf("%s",a1);
for(int i=0;a[i]!='\0';i++)
count++;
p=a1+(count-1);
reverse(a1,p);
printf("the reversed one is : %s",a1);
getch();
}
void reverse(char *a1,char *p)
{
char temp;
if(a1<=p)
{
temp=*a1;
*a1=*p;
*p=temp;
reverse(++a1,--p);
}
}




thank u

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What language is c written?

1098


Explain why c is faster than c++?

1124


Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor

3598


Is it cc or c in a letter?

1077


Explain what is meant by high-order and low-order bytes?

1089


What is I ++ in c programming?

1165


What does the function toupper() do?

1188


Apart from dennis ritchie who the other person who contributed in design of c language.

1473


Write a program to know whether the input number is an armstrong number.

1169


Is c is a middle level language?

1122


What are different types of pointers?

1105


What are local static variables?

1204


What is the importance of c in your views?

1231


a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list

1115


Tell me with an example the self-referential structure?

1075