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 does new do in c++?

808


Are strings immutable in c++?

873


Write a program using GUI concept for the scheduling algorithms in Operating system like SJF,FCFS etc..

3567


What does catch(…) mean?

829


Can char be a number c++?

775


What are the two types of comments?

750


What are static type checking?

798


what is Loop function? What are different types of Loops?

872


What is null pointer and void pointer?

803


What is the header file for setw?

794


Why is c++ difficult?

784


In what situations do you have to use initialization list rather than assignment in constructors?

815


Draw a flow chart and write a program for the difference between the sum of elements with odd and even numbers. Two dimensional array.

6117


What do you mean by persistent and non persistent objects?

1027


What are references in c++?

860