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

How can I get the current date or time of day in a c program?

1185


What are the header files used in c language?

1007


Which is the memory area not included in C program? give the reason

1911


An application package has been provided to you without any documents for the following application. The application needs to be tested. How will you proceed?

1198


how to print electricity bill according to following charges first 100 units -1rs per unit for next 200 units-1.50 rs per unit without using conditions

3146


What are the types of macro formats?

1070


How do you list a file’s date and time?

1036


What is meant by initialization and how we initialize a variable?

1014


What are the different types of control structures?

998


What is a list in c?

990


What is a pointer on a pointer in c programming language?

1102


regarding pointers concept

1989


Can we compile a program without main() function?

1084


A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers

1142


Is fortran still used in 2018?

998