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
Explain what is gets() function?
What is const keyword in c?
Explain what are linked list?
What is the difference between text files and binary files?
What are pointers really good for, anyway?
How do you redirect a standard stream?
Where register variables are stored in c?
What is the difference between abs() and fabs() functions?
illustrate the use of address operator and dereferencing operator with the help of a program guys plzzz help for this question
What is the advantage of using #define to declare a constant?
Explain function?
What are the __date__ and __time__ preprocessor commands?
Is anything faster than c?
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
can we have joblib in a proc ?