write a program to swap Two numbers without using temp variable.

Answer Posted / prasanna

Swapping two variables in a single line with no temporary
variable..

b=(a+b)-(a=b);

so.. simple..

Prasanna. (prasanna7287@yahoo.co.in)

Is This Answer Correct ?    351 Yes 140 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Program will then find the largest of three numbers using nested if-else statements. User is prompted to enter three numbers. Program will find the largest number and display it on the screen. All three numbers entered by the user are also displayed. If user enters 21, 33, and 5, the output should be as follows: You entered: 21, 33 and 5. The largest number is 33.

1004


What is c basic?

589


What are void pointers in c?

559


What is a string?

652


Place the #include statement must be written in the program?

556






What is #define in c?

605


What are enums in c?

647


How many parameters should a function have?

650


What is the difference between c &c++?

635


What is function in c with example?

615


How is actual parameter different from the formal parameter?

581


Difference between linking and loading?

681


What are the 5 types of inheritance in c ++?

564


hi, which software companys will take,if d candidate's % is jst 55%?

1644


A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers

636