WRITE A SIMPLE C++ PROGRAM TO SWAP TWO NOS WITHOUT USING TEMP

Answers were Sorted based on User's Feedback



WRITE A SIMPLE C++ PROGRAM TO SWAP TWO NOS WITHOUT USING TEMP..

Answer / vinodhini r

main()
{
int a,b;
scanf("%d %d",&a,&b);
a=a+b;
b=a-b;
a=a-b;
printf("%d %d",a,b);
}

Is This Answer Correct ?    26 Yes 2 No

WRITE A SIMPLE C++ PROGRAM TO SWAP TWO NOS WITHOUT USING TEMP..

Answer / illa

sorry that is correct

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More OOPS Interview Questions

What is abstraction?

9 Answers  


What are two types of polymorphism?

0 Answers  


Which is the only operator in C++ which can be overloaded but NOT inherited?

8 Answers  


Which language is not a true object oriented programming language?

0 Answers  


OOP'S advantages of inheritance include:

1 Answers   Infosys,


What is the use of fflush(stdin) in c++?

4 Answers   HCL,


What is property in oops?

0 Answers  


Is this job good for future? can do this job post grduate student?

0 Answers  


IS IT NECESSARY TO INITIALIZE VARIABLE? WHAT IF THE INSTANCE VARIABLE IS DECLARED final ? IS IT NECESSARY TO INITIALIZE THE final VARIABLE AT THE TIME OF THEIR DECLARATION?

0 Answers  


What is multiple inheritance? Give Example

6 Answers   Mind Tree,


3. Differentiate verification and validation.

1 Answers  


what is polymorpsim? what are its types?

8 Answers  


Categories