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

Can you sort a set c++?

520


Which command properly allocates memory a) char *a=new char[20]; b) char a=new char[20]; c) char a=new char(20.0);

612


If you don’t declare a return value, what type of return value is assumed?

538


What is the difference between ++ count and count ++?

571


What apps are written in c++?

598






You want to link a c++ program to c functions. How would you do it?

534


Explain 'this' pointer and what would happen if a pointer is deleted twice?

594


What is the purpose of ios::basefield in the following statement?

781


What are the advantages of prototyping?

559


Define a pdb file.

635


What is a static member?

604


Can recursive program be written in C++?

625


Difference between Abstraction and encapsulation in C++?

571


In a function declaration, what does extern mean?

634


What are the various operations performed on stack?

622