title: Using Pointers In C swapping three numbers
body: <pre><code>#include &lt;stdio.h&gt;
  
  
  int main() {
  
   int a, b,c; 
  
    /* Input a and b */
  
   scanf("%d %d %d", &amp;a, &amp;b,&amp;c);
  
     while(a != -1) {
  
     int *x = &amp;a;
  
     int *y = &amp;b;
  
     int *z = &amp;c;
  
     printf("Original inputs:   a:%d\tb:%d\tc:%d\n", a, b,c);     
  
     reorder(a,b,c);  
  
     swap(a,b);
  
     printf("Rearranged inputs: a:%d\tb:%d\tc:%d\n\n", a, b,c);  
  
     break;
  
     }
  
     }
  
  void reorder(int *x, int *y, int *z){
  
  
   if(*x &gt; *y)
  
   {
  
    int temp = *x;
  
    *x = *y;
  
    *y = temp;
  
    }else if(*y &gt; *z){
  
    int temp = *y;
  
    *y = *z;
  
  
    *z = temp;
  
    }else if(*x &gt; *z){
  
    int temp = *x;
  
    *x = *z;
  
    *z = temp;    
  
    }
  
    }
  
  
   void swap(int *px, int *py)
   {
  
   int temp;
  
   temp = *px;
  
   *px = *py;
  
   *py = temp;
  
    }
  </code></pre>
  
  <p>I am new to C and learning pointers am not sure how to implement pointers to swap 3 numbers in ascending order</p>