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

write a program to print * * * * * *

2 Answers  


Which is the best institute in hyderabad for C/C++ and it also has fast track course structure.

13 Answers   Wipro,


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

2 Answers  


What is the significance of classes in oop?

0 Answers  


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

2 Answers   CSC, Infinite Computer Solutions,






Write a program to get the binary tree.

3 Answers   ABC,


why we are declare the function in the abstract class even though we are declaring it in Derived class?

1 Answers   TCS,


swapping program does not use third variable

5 Answers   TCS,


write a C++ program for booking using constructor and destructor.

0 Answers   HAL,


What are the advantages of inheritance?

26 Answers   IBS, TCS,


Explain the concepts involved in Object Oriented programming.

0 Answers   Wipro,


What is the differances between a abstract calss and interface

5 Answers   Aviva, Symphony,


Categories