write a program to swap Two numbers without using temp variable.
Answer Posted / abhi
void swap(int *a,int *b)
{
if(*a == *b)
return;
*a^=*b;
*b^=*a;
*a^=*b;
}
Is This Answer Correct ? | 461 Yes | 195 No |
Post New Answer View All Answers
Do you have any idea how to compare array with pointer in c?
Why should I prototype a function?
What functions are used in dynamic memory allocation in c?
What is unary operator?
What is the difference between abs() and fabs() functions?
What is New modifiers?
what is the difference between 123 and 0123 in c?
i = 25;switch (i) {case 25: printf("The value is 25 ");case 30: printf("The value is 30 "); When the above statements are executed the output will be : a) The value is 25 b) The value is 30 c) The value is 25 The value is 30 d) none
How are variables declared in c?
What is dynamic memory allocation?
How do shell structures work?
Explain what happens if you free a pointer twice?
write a program to copy the string using switch case?
a direct address that identifies a location by means of its displacement from a base address or segment a) absolute address b) relative address c) relative mode d) absolute mode
What is volatile variable in c with example?