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

#include<stdio.h>
void strrev(char *);
main()
{
char s1[10];
printf("enter the string:");
scanf("%s",s1);
strrev(s1);
}
void strrev(char *p)
{
int i,j;
i=0,j=strlen(p)-1;
char temp;
while(i<j)
{
temp=p[i];
p[i]=p[j];
p[j]=temp;
i++;
j--;
strrev(s1);
}

Is This Answer Correct ?    5 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is infinite loop?

1078


What are the data types present in c?

1155


What are lookup tables in c?

994


What is the value of uninitialized variable in c?

1028


What is the difference between a string and an array?

1195


Can you mix old-style and new-style function syntax?

1097


What is pass by value in c?

1062


If I have a char * variable pointing to the name of a function ..

1162


What is array in c with example?

1236


Explain how can I pad a string to a known length?

1187


Write a program to generate the Fibinocci Series

1225


What is nested structure?

1033


How do we make a global variable accessible across files? Explain the extern keyword?

1873


Does sprintf put null character?

1031


A program is required to print your biographic information including: Names, gender, student Number, Cell Number, line of study and your residential address.

1708