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
Write a program to implement OOPS concepts such as inheritance, polymorphism, friend function, operator overloading?
What are the data types in oop?
Can private class be inherited?
How oops is better than procedural?
what is the sylabus for priliminaries?
What is this pointer in oop?
Whats is abstraction in oops?
What are the 5 oop principles?
What is encapsulation c#?
class CTest { public: void someMethod() { int nCount = 0; cout << "This is some method --> " << nCount; } }; int main() { CTest *pctest; pctest->someMethod(); return 0; } It will executes the someMethod() and displays the value too. how is it possible with our creating memory for the class . i think iam not creating object for the class. Thanks in Advance... Prakash
What is multilevel inheritance?
What is variable example?
What do you mean by abstraction?
What is interface in oop?
What are oops functions?