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 how does flowchart help in writing a program?
what is stack , heap ,code segment,and data segment
What is wrong with this statement? Myname = 'robin';
a construct the"else" part of "if" statement contains anoth "if else" statement is called a) if-else b) else-if-else c) if-else-if-else d) chain if/if-else-if
How can I direct output to the printer?
Explain the advantages of using macro in c language?
What is the difference between void main and main in c?
cavium networks written test pattern ..
What is c language used for?
which is conditional construct a) if statement b) switch statement c) while/for d) goto
Explain how do you determine whether to use a stream function or a low-level function?
Explain low-order bytes.
What is the difference between the = symbol and == symbol?
What are the 5 data types?
In which language linux is written?