Answer Posted / venkanna
swap(a,b);
{
a=a+b;
b=a-b;
a=a-b;
}
Explenation:
if a=5 and b=10
a=a+b(5+10)=15
b=a-b(15-10)=5------------swaped here
a=a-b(15-5)=10------------
| Is This Answer Correct ? | 6 Yes | 2 No |
Post New Answer View All Answers
What is encapsulation in oop?
Can destructor be overloaded?
Why oops is important?
What is the purpose of polymorphism?
What is an example of genetic polymorphism?
What is oops and its features?
What is object and example?
What are the data types in oop?
What is the oops and benefits of oops programming?
What is abstraction and encapsulation?
How to use CMutex, CSemaphore in VC++ MFC
What is for loop and its syntax?
Why is polymorphism important in oop?
Why interface is used?
What is the fundamental idea of oop?