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

Does free set pointer to null?

0 Answers  


can u write a program in C, which does not use = (eqaul)or any arithmatic assignment(like -=,+=,*= etc) operator to swap to number?

2 Answers  


why we are using semicolon at the end of printh statment

2 Answers   HCL,


Difference between data structure and data base.

7 Answers   CTS, Value Labs, Zoho,


How do I use strcmp?

0 Answers  


write a c program to find the sum of five entered numbers using an array named number

0 Answers   TATA,


write a program to interchange the value between two variable without using loop

1 Answers  


Multiply an Integer Number by 2 Without Using Multiplication Operator

0 Answers  


What is malloc return c?

0 Answers  


Explain how does free() know explain how much memory to release?

0 Answers  


how to implement stack work as a queue?

2 Answers  


how many error occurs in C language ?

22 Answers   Infosys, Wipro,


Categories