how to swap two numbers with out using temp variable

Answer Posted / sachin patil

a = 5;
b = 10;
a = a+b;
b = a-b;
a = a-b;

Is This Answer Correct ?    55 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the basic concept of c++?

570


What is command line arguments in C++? What are its uses? Where we have to use this?

571


What are the uses of typedef in a program?

602


Do you know what are static and dynamic type checking?

612


What is private inheritance?

592






List the merits and demerits of declaring a nested class in C++?

599


Why is null pointer used?

674


Explain what are single and multiple inheritances in c++?

557


Explain the concept of friend function in c++?

597


What is #include c++?

563


In which header file does one find isalpha() a) conio.h b) stdio.h c) ctype.h

671


When should you use global variables?

623


Why do we need templates?

534


When the constructor of a base class calls a virtual function, why doesn't the override function of the derived class gets called?

562


Explain one-definition rule (odr).

637