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
What’s the special use of UNIONS?
What is double pointer?
What is the difference between malloc calloc and realloc in c?
Is there a built-in function in C that can be used for sorting data?
Who is the main contributor in designing the c language after dennis ritchie?
Explain how can I avoid the abort, retry, fail messages?
What is the right type to use for boolean values in c? Is there a standard type? Should I use #defines or enums for the true and false values?
Tell me what is the purpose of 'register' keyword in c language?
Can a local variable be volatile in c?
Explain how can I manipulate strings of multibyte characters?
An expression to whose value an operater is applied a) operand b) variable c) constant d) all of the above
Hai sir, I had planned to write the NIC scientific engineer exam , plz post the sample question......
Are comments included during the compilation stage and placed in the EXE file as well?
Write a code on reverse string and its complexity.
a=10;b= 5;c=3;d=3; if(a printf(%d %d %d %d a,b,c,d) else printf("%d %d %d %d a,b,c,d);