write a program to swap Two numbers without using temp variable.
Answer Posted / guest
using xor technique is much faster than using addition and
subtraction process , and xor instruction is much simpler at
processor level.
so be simply
x = x xor y
y = x xor y
x = x xor y
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Explain enumerated types in c language?
What are pointers?
Which is better between malloc and calloc?
What is structure of c program?
How main function is called in c?
What is sorting in c plus plus?
What is the function of this pointer?
What is the explanation for prototype function in c?
what do you mean by inline function in C?
Explain what are bus errors, memory faults, and core dumps?
What is the difference between variable declaration and variable definition in c?
void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }
What is spaghetti programming?
What is the purpose of realloc()?
What is the difference between āgā and āgā in C?