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

How do you answer polymorphism?

0 Answers  


What is difference between class and object with example?

0 Answers  


What is new keyword in oops?

0 Answers  


Can abstract class have normal methods?

0 Answers  


What is abstrac class?where is it use?

2 Answers  






Why do we use class in oops?

0 Answers  


What is abstraction oop?

0 Answers  


You attempt to query the data base with this command: SELECT name, salary FROM employee WHERE salary=(SELECT salary FROM employee WHERE last name='Wagner' OR dept no=233) Choose most appropriate option from the following: 1)Sub-queries are not allowed in the where clause. 2)a multiple row sub-query used with a single row comparison operator. 3)a single row query is used with a multiple row comparison operator.

10 Answers   Zycus Infotech,


what is difference between objects and function

1 Answers  


What is the difference between and interface and an abstract class ?

4 Answers   IBM, Infosys, Ness Technologies,


write a program using c++ to implement single contiguous memory mangement techniques.display the content of the main memory after yhe allocation of jobs and percentage of the wastage of the main memory

0 Answers  


write a function that takes an integer array as an input and finds the largest number in the array. You can not sort array or use any API or searching needs?

2 Answers   IBMS, Zycus Infotech,


Categories