write a program to swap Two numbers without using temp variable.
Answer Posted / anantha
b=a+b
a=b-a
b=b-a
if a=3 and b=5
then now b=a+b=8
and a=8-a=8-3=5,now a=5
b=8-a=8-5=3,now b=3
so, a=5 and b=3
| Is This Answer Correct ? | 198 Yes | 59 No |
Post New Answer View All Answers
Is c is a middle level language?
What is methods in c?
Why is event driven programming or procedural programming, better within specific scenario?
What are the advantages of union?
Can you write the algorithm for Queue?
What is the correct code to have following output in c using nested for loop?
Explain how are 16- and 32-bit numbers stored?
What is the use of extern in c?
What is variables in c?
What do you mean by dynamic memory allocation in c?
What is the data segment that is followed by c?
How to compare array with pointer in c?
What is meant by type specifiers?
What is New modifiers?
What does %d do in c?