write a program to swap Two numbers without using temp variable.
Answer Posted / dhruv
I am not giving an answer, but just wanted to point out that
most of the solutions which try to add (a+b) and then
subtract from it will not work if (a+b) exceeds the maximum
value an int can hold.
So even if it looks good on paper it will give erroneous
results when run on a machine
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
int main() { Int n=20,i; For(i=0;i<=n;i--) { Printf(“-“); Return 0;
What is variable initialization and why is it important?
Differentiate between full, complete & perfect binary trees.
Explain what math functions are available for integers? For floating point?
When I set a float variable to, say, 3.1, why is printf printing it as 3.0999999?
How do I use strcmp?
What is array of structure in c programming?
What is wrong with this code?
Explain the difference between malloc() and calloc() function?
console I/O functions means a) the I/O operations done on disk b) the I/O operations done in all parts c) the input given through keyboard is displayed VDU screen d) none of the above
What is chain pointer in c?
writ a program to compare using strcmp VIVA and viva with its output.
What is union in c?
Tell us the use of fflush() function in c language?
Explain how do you view the path?