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
How do you do dynamic memory allocation in C applications?
Write a program to reverse a given number in c language?
Is c is a procedural language?
Are pointers really faster than arrays?
Implement bit Array in C.
Explain what are the advantages and disadvantages of a heap?
Differentiate between full, complete & perfect binary trees.
What are the advantages of external class?
What is a buffer in c?
Can include files be nested?
What are the Advantages of using macro
What is property type c?
What is the correct code to have following output in c using nested for loop?
What library is sizeof in c?
what will be maximum number of comparisons when number of elements are given?