wat are the two methods for swapping two numbers without
using temp variable??

Answer Posted / shrikantauti

i dont know the methods but can give the code to swap values without temporary variable.
a b
a=a+b
b=a-b
a=a-b

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Here is a good puzzle: how do you write a program which produces its own source code as output?

592


hi to every one .. how to view table pool after creating the pooled table? plz help me.. if any knows abt this ..

1465


What is the benefit of using an enum rather than a #define constant?

655


we need to calculating INCOME TAX for the person. The INCOME TAX is as follows:- First $10000/- of income : 4% tax Next $10000/- of income : 8% tax Next $10000/- of income : 11.5% tax above $10, 00,00/- : 15% tax What is the Solution of this Question ?

803


Explain pointers in c programming?

631






Differentiate between new and malloc(), delete and free() ?

669


what are bit fields in c?

599


write a program to input 10 strings and compare without using strcmp() function. If the character of one string matches with the characters of another string , sort them and make it a single string ??? example:- str1="Aakash" st2="Himanshu" str="Uday" output:- Aakashimanshuday (please post the answer as quickly as possible)

1625


formula to convert 2500mmh2o into m3/hr

493


Draw a diagram showing how the operating system relates to users, application programs, and the computer hardware ?

2117


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

579


what are the different storage classes in c?

660


Was 2000 a leap year?

629


Is null equal to 0 in sql?

648


main use of recursive function a) processing speed high b) reduce program length/reduce repeated statements c) if you do not, use iterative methods like, for, while or do-while d) all the above

613