m2skills

swap1

Mar 29th, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.18 KB | None | 0 0
  1. // method that swaps numbers using + and - operations  
  2. void swap1(int *num1, int *num2){
  3.     *num1 = *num1 + *num2;
  4.     *num2 = *num1 - *num2;
  5.     *num1 = *num1 - *num2;
  6.    
  7.     return;
  8. }
Add Comment
Please, Sign In to add comment