min and max simultaneously
int t = a + b;
a = a &gt; b ?  t - a : a;
b = t - a;
// a is the small one


Or 

small = a;
large = b;
if (a&gt;b) {
  small = b;
  large = a;
} 


But I think it will be shorter in Python:

if a &gt; b:
   a, b = b, a