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 a function in oop?
What are main features of oop?
What is an example of genetic polymorphism?
What is encapsulation and abstraction? How are they implemented in C++?
What is the problem with multiple inheritance?
Why do we use polymorphism in oops?
What is polymorphism what are the different types of polymorphism?
What is destructor example?
Why is static class not inherited?
What does it mean when someone says I oop?
What is the real life example of polymorphism?
write a program to find 2^n+1 ?
Why do we use oops?
Can a varargs method be overloaded?
What is the significance of classes in oop?