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 calloc malloc realloc in c?

1013


What is difference between structure and union?

1082


What is the difference between void main and main in c?

1101


What is the difference between malloc() and calloc()?

1699


Explain modulus operator.

1001


What is linear search?

1091


What are the types of i/o functions?

1256


What is scope of variable in c?

994


can anyone suggest some site name..where i can get some good data structure puzzles???

2021


What is 'bus error'?

1094


Should I learn data structures in c or python?

977


Design a program which assigns values to the array temperature. The program should then display the array with appropriate column and row headings.

2277


What are global variables?

1119


Explain how do you override a defined macro?

1021


What functions are in conio h?

1154