how to swap two numbers with out using temp variable

Answer Posted / pranav

//swaping of 2 numbers without using temp variable
//a=5 & b=6
a=a+b; //a=30
b=a-b; //b=5
a=a-b; //a=6

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

In int main(int argc, char *argv[]) what is argv[0] a) The first argument passed into the program b) The program name c) You can't define main like that

611


What are punctuators in c++?

642


Should I learn c or c++ first?

562


Do vectors start at 0 c++?

526


What is the use of lambda in c++?

571






Can manipulators fall in love?

559


write a porgram in c++ that reads an integer and print the biggest digit in the number

1763


Explain rtti.

589


Is c++ built on c?

556


What is expression parser in c++

1884


What are the general quetions are in DEna bank manager IT/System interviews?

1531


When must you use a pointer rather than a reference?

598


Is java the same as c++?

541


What are the uses of typedef in a program?

608


What is c++ manipulator?

550