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 swap two nubers by using a function with pointers?

Answer Posted / reshma

void swap(int *a, int *b)
{
int tmp;
tmp=*a;
*a=*b;
*b=tmp;
}

or

void swap(int *a, int *b)
{
*a=*a^*b;
*b=*a^*b;
*a=*a^*b;

}

Is This Answer Correct ?    10 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what is gets() function?

1060


What is const keyword in c?

1149


Explain what are linked list?

1037


What is the difference between text files and binary files?

1338


What are pointers really good for, anyway?

1049


How do you redirect a standard stream?

1088


Where register variables are stored in c?

949


What is the difference between abs() and fabs() functions?

1104


illustrate the use of address operator and dereferencing operator with the help of a program guys plzzz help for this question

2057


What is the advantage of using #define to declare a constant?

1077


Explain function?

1076


What are the __date__ and __time__ preprocessor commands?

1092


Is anything faster than c?

997


main use of recursive function a) processing speed high b) reduce program length/reduce repeated statements c) if you do not, use iterative methods like, for, while or do-while d) all the above

1072


can we have joblib in a proc ?

2286