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

a c variable cannot start with a) an alphabet b) a number c) a special symbol d) both b and c above

1233


What is oops c?

1259


How macro execution is faster than function ?

1204


How can I call a function with an argument list built up at run time?

1248


Do you know pointer in c?

1059


What is a macro, and explain how do you use it?

1086


Write a C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT" into the given database.

1979


Explain zero based addressing.

1040


How would you rename a function in C?

1047


Is there anything like an ifdef for typedefs?

1156


process by which one bit patten in to another by bit wise operation is? (a) masking, (b) pruning, (c) biting, (d) chopping,

2432


What is meant by realloc()?

1164


What does int main () mean?

1035


Where can I get an ansi-compatible lint?

1155


An arrangement of information in memory in such a way that it can be easily accessed and processed by a programming language a) string b) data structure c) pointers d) array

1143