how to swap the variables without using temp and operators
Answer Posted / santhosh
int a, b;
a = 10;
b = 20;
a = a + b;
//a=30
b = a - b;
a = a - b;
Console.WriteLine("a={0},b={1}", a, b);
Console.ReadLine();
| Is This Answer Correct ? | 10 Yes | 2 No |
Post New Answer View All Answers
What is oops and its features?
What is polymorphism what are the different types of polymorphism?
What is the difference between a constructor and a destructor?
What is the purpose of enum?
Following are the class specifications: class {int a}; class {int b}; Using friend funtion,calculate the max of two objects and display it.
What is protected in oop?
Is oop better than procedural?
Which is better struts or spring?
Why we use classes in oop?
when to use 'mutable' keyword and when to use 'const cast' in c++
What polymorphism means?
Can main method override?
Why is static class not inherited?
What is constructor overloading in oop?
What is coupling in oops?