Technology Blog

the technology I am interested in and work with

Showing posts with label swap integers. Show all posts
Showing posts with label swap integers. Show all posts
Tuesday, June 21, 2011

Swap 2 integers without using a temp variable

›
There are 2 ways to do it.  use sum of the 2 variables:   void swap(int a , int b) {        a = a + b;        b = a - b;        a = a - b ...
›
Home
View web version
Powered by Blogger.