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?



how to swap two nubers by using a function with pointers?..

Answer / 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

More C Interview Questions

What will happen when freeing memory twice

2 Answers  


A program to write a number of letters and numbers, such as counting and display

0 Answers  


What is a macro?

0 Answers  


Why do we use main function?

0 Answers  


How to calculate Total working time using Login and logout?

2 Answers   CTS, Cygnus, Infosys, Signal Networks, TCS, Wipro,


How do I get an accurate error status return from system on ms-dos?

0 Answers  


How would you use the functions fseek(), freed(), fwrite() and ftell()?

0 Answers   Aspire, Infogain, TISL,


Can you pass an entire structure to functions?

0 Answers  


What is c system32 taskhostw exe?

0 Answers  


what is meant by c

9 Answers   INiTS,


A collection of data with a given structure for excepting storing and providing on demand data for multiple users a) linked list b) datastructer c) database d) preprocessor

0 Answers  


program for validity of triangle from 3 side

7 Answers  


Categories