Hi All,
I am new to programming and want to know how can i write a
code to take input of 2 numbers from user and swap it
without using a temp variable?

Answers were Sorted based on User's Feedback



Hi All, I am new to programming and want to know how can i write a code to take input of 2 numbers..

Answer / x

a=a+b;
b=a-b;
a=a-b;

Is This Answer Correct ?    3 Yes 1 No

Hi All, I am new to programming and want to know how can i write a code to take input of 2 numbers..

Answer / gopi

a=A+b;
b=a-b;
a=a-b;

Is This Answer Correct ?    4 Yes 3 No

Post New Answer

More OOPS Interview Questions

What is command routing in MFC

1 Answers   GE,


What does enum stand for?

0 Answers  


JAVA is FULLY OBJECT ORIENTED PROGRAMING LANGUAGE?

3 Answers  


Write a program to implement OOPS concepts such as inheritance, polymorphism, friend function, operator overloading?

0 Answers   TCS,


What is abstraction oop?

0 Answers  






What is a template?

7 Answers  


What is difference between inheritance and polymorphism?

0 Answers  


What does and I oop and sksksk mean?

0 Answers  


why to use template classes in c++?

1 Answers  


What is operator overloading? Give Example

11 Answers   CTS, IBM, TCS,


write a program to find 2 power of a 5digit number with out using big int and exponent ?

0 Answers  


What is abstraction with example?

0 Answers  


Categories