title: In C++ abs( *a - *b) does not return absolute value of negative number
body: <pre><code>#include &lt;stdio.h&gt;
  #include &lt;cmath&gt;
  
  void update(int *a,int *b) {
      // Complete this function 
      (*a) = abs(*a + *b);
      (*b) = abs(*a - *b);   
  }
  
  int main() {
      int a, b;
      int *pa = &amp;a, *pb = &amp;b;
  
      scanf("%d %d", &amp;a, &amp;b);
      update(pa, pb);
      printf("%d\n%d", a, b);
  
      return 0;
  }
  </code></pre>
  
  <p>I have the following code (from HackerRank C++ problems). If I have 4 and 5 as input it will return 9 and 4 as output rather than 9 and 1. I thought it will go 4 - 5 = abs(-1) = 1. Why does it not work like that?</p>