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 string "Hello World" by using pointers only.
Without any temp var

Answer Posted / aravind

#include<stdio.h>
char reverse(char *, char *);
int main()
{
char a[]="hello"
char b[]="world";
gets(a,b);
puts(a); /*displays Hello world*/
reverse(a,b);

char reverse(char *ptr, char *ptr1)
{
int i,j;
for(i=0;i!='\0';i++)
{
printf("%s",*ptr);
ptr++;
}
for(j=0;j!='\0';j++)
{
printf("%s",*ptr1);
ptr1++;
}
gets(*ptr1,*ptr);
puts(*ptr1); /*displays world hello*/
}

Is This Answer Correct ?    0 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Where static variables are stored in c?

1041


Explain threaded binary trees?

1105


When we use void main and int main?

1017


Read the following data in two different files File A: aaaaaaaadddddddd bbbbbbbbeeeeeeee ccccccccffffffff File B: 11111111 22222222 33333333 By using the above files print the following output or write it in the Other file as follows aaaaaaaa11111111dddddddd bbbbbbbb22222222eeeeeeee cccccccc33333333ffffffffffff

3205


Explain what is the difference between the expression '++a' and 'a++'?

1152


Difference between linking and loading?

1060


how to write a c program to print list of fruits in alpabetical order?

2240


Which control loop is recommended if you have to execute set of statements for fixed number of times?

1297


pierrot's divisor program using c or c++ code

2168


how could explain about job profile

1856


How many data structures are there in c?

1063


What are structure types in C?

1048


Give basis knowledge of web designing ...

1980


Difference between pass by reference and pass by value?

1096


What is static memory allocation?

1099