how to swap two numbers with out using temp variable

Answer Posted / vaibhav meena

Its simple:
For Integer Values

A^=B^=A

and with arithmetic operators :

All the above answers are right

Is This Answer Correct ?    7 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is endl?

723


Explain the properties and principles of oop.

622


When does the c++ compiler create temporary variables?

664


Is map thread safe c++?

740


What is a null object in c++?

739






What are default parameters? How are they evaluated in c++ function?

766


Explain terminate() and unexpected() function?

698


What do you mean by ‘void’ return type?

720


Explain the differences between private, public and protected and give examples.

652


What is std :: endl?

681


Explain about Garbage Collector?

753


Using a smart pointer can we iterate through a container?

660


What is static class data?

656


Is c++ proprietary?

665


How can you create a virtual copy constructor?

686