how to swap two numbers with out using temp variable

Answer Posted / raja

if a=10& b=20

a=a+b //a=30
b=a-b //b=10
a=a-b //a=20

finally we got a=20,b=10

Is This Answer Correct ?    10 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is tellg () in c++?

716


How can I improve my c++ skills?

552


List the issue that the auto_ptr object handles?

602


What are the defining traits of an object-oriented language?

683


Briefly describe a B+ tree. What is bulk loading in it?

789






What is the use of setfill in c++?

576


What is set in c++?

651


What is c++ flowchart?

669


Describe about storage allocation and scope of global, extern, static, local and register variables?

723


Should I learn c++ c?

599


Define stacks. Provide an example where they are useful.

570


Is empty stack c++?

514


What will happen if a pointer is deleted twice?

716


Is c++ an integer?

568


How do you initialize a string in c++?

550