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

main() { printf("hello"); fork(); }

0 Answers   Wilco,


any function have arguments one or more OR not . it is compulsary a) any function compulsary have one or more arguments b) any function did not have arguments. It is not compulsary c) it is optional it is not compulsary d) none of the above

0 Answers  


Do variables need to be initialized?

0 Answers  


What's the difference between constant char *p and char * constant p?

0 Answers   Celstream,


Write a program to generate the first n terms in the series --- 9,11,20,31,...,82

1 Answers   Cognizant,


When should you use a type cast?

0 Answers  


What does it mean when a pointer is used in an if statement?

0 Answers  


suppose there are five integers write a program to find larger among them without using if- else

2 Answers  


How does selection sort work in c?

0 Answers  


Explain what are the standard predefined macros?

0 Answers  


Describe the order of precedence with regards to operators in C.

0 Answers  


Why & is used in c?

0 Answers  


Categories