How do we swap or interchange any 2 numbers without using
Temporary variable...Anybody can pls answer it.. Thanks in
Advance
Answer Posted / raghuram.a
int x,y;
x =x-y;
y =y+x;
x =y-x;
or
int x,y;
x=x^y;
y=x^y;
x=x^y;
| Is This Answer Correct ? | 11 Yes | 7 No |
Post New Answer View All Answers
Explain the use of bit fieild.
if p is a string contained in a string?
What are the valid places to have keyword “break”?
Explain that why C is procedural?
What is const volatile variable in c?
Differentiate between null and void pointers.
Write a C++ program to generate 10 integer numbers between - 1000 and 1000, then store the summation of the odd positive numbers in variable call it sum_pos, then find the maximum digit in this variable regardless of its digits length.
Is it possible to initialize a variable at the time it was declared?
Differentiate between new and malloc(), delete and free() ?
using for loop sum 2 number of any 4 digit number in c language
how to count no of words,characters,lines in a paragraph.
Explain what are binary trees?
How to declare pointer variables?
Why do we use null pointer?
Does * p ++ increment p or what it points to?