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

Please tell me the oops concept with detailed answer

9 Answers   EEE,


What is polymorphism and types?

0 Answers  


Prepare me a program for the animation of train

0 Answers  


What are the OOPS concepts?

106 Answers   A1 Technology, Bajaj, CTS, EDS, HP, Infosys, Intel, Microsoft, MNC, Persistent, PlanetSoft, ProConstructor, TCS, Virtusa, Wipro, YSoft Solutions,


What is overloading and its types?

0 Answers  






What is Hashing and how is it done? Pictorial form?

2 Answers   emc2, Wipro,


write a short note on Overloading of Binary Operator?

2 Answers  


Write a program to sort the number with different sorts in one program ??

0 Answers   NIIT,


Write a program to accept a number and to print numbers in pyramid format? for eg:for a no. 5 1 212 32123 4321234 543212345

7 Answers  


Can private class be inherited?

0 Answers  


Why we are use # in begning of programme of c++.

2 Answers   Syntel,


Can we create object of interface?

0 Answers  


Categories