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 |
Explain what is a pragma?
Explain what is the most efficient way to store flag values?
What is the hardest programming language?
to find out the reverse digit of a given number
6 Answers Infosys, Microsoft, TCS, Wipro,
What does the format %10.2 mean when included in a printf statement?
How do you sort filenames in a directory?
Explain the difference between exit() and _exit() function?
difference between spiral and waterfall model
how should functions be apportioned among source files?
What is an lvalue and an rvalue?
List at least 10 sorting methods indicating their average case complexity, worst case complexity and best case complexity.
Explain how can I open a file so that other programs can update it at the same time?