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

what is code for call by value and call by reference?

1 Answers  


What is difference between #define and const?

3 Answers   emc2,


• What are the desirable attributes for memory managment?

0 Answers  


What is the difference between the C & C++?

9 Answers   HCL,


What is pure oop?

0 Answers  


What is the importance of oop?

0 Answers  


Iam doing my project on instant messaging , if you any new ideas regarding this project ,please suggest it?

2 Answers  


What is object-oriented programming? Webopedia definition

0 Answers  


Write a program in c++ to read two floating point numbers and find their sum and average.

2 Answers  


What do you mean by stack program? Get me an example stack program?

4 Answers  


What does no cap mean?

0 Answers  


DIFFRENCE BETWEEN STRUCTURED PROGRAMING AND OBJCET ORIENTED PROGRAMING.

5 Answers  


Categories