카테고리 없음

How to swap tow numbers without using Temporary variable or arithmetic operators?

윤보람 2014. 2. 3. 20:21

http://www.thecrazyprogrammer.com/2014/02/how-to-swap-two-numbers-without-using-temporary-variable-or-arithmetic-operators.html


Lets take two numbers a=5 and b=7

temp=a;

a=b;

b=temp;


연산자를 이용해서 임시 변수없이도 멋지게 스왑할 수 있다.