View Single Post
  #4 (permalink)  
Old 10-12-2008, 12:07 PM
Paul Richards Paul Richards is offline
Member
 
Join Date: Oct 2008
Location: UK
Posts: 36
Paul Richards is on a distinguished road
And here is the other way:

Code:
public int swapTensAndUnits(int n) { int tens = (n/10)%10; int units = n%10; int rest = n-n%100; return rest+units*10+tens; }
Reply With Quote