how to swap the variables without using temp and operators



how to swap the variables without using temp and operators..

Answer / 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

More OOPS Interview Questions

features of OOPS

22 Answers   Ness Technologies, Satyam,


What are the valid types of data that the main () can return in C/C++ language

3 Answers  


How do you make derived class as an abstract class?

1 Answers   Convergys, TCS,


tel me oops defination in single line

2 Answers  


Templates mean

0 Answers  






Hi friends I have experience of 6 months in website design and maintanence. Now i am looking for other IT jobs.. to switch platform. please post any interview you know in chennai.

0 Answers  


How can we use the preprocessor #if and #elseif.

2 Answers  


How is data security provided in Object Oriented languages? ?

5 Answers  


what is opps?why it is use in programming language?

2 Answers   Wipro,


How compiler selects(internally) required overridden function in inheritance?

2 Answers   CSC, Infinite Computer Solutions,


What is overriding in oop?

0 Answers  


why we call c++ is object oriented lanaguage

7 Answers   HCL,


Categories