title: c pointer with function and money
body: <p>Write a program to dispense change.  The user enters the amount paid and the amount due.   The program determines how many dollars, quarters, dimes, nickels, and pennies should be given as change.  Ask the user for the two inputs (amount due and amount paid) in main() and then send these along with pointers to 5 parameters (dollars, quarters, dimes, nickels, pennies) to a function called change(), which will then calculate the number of each to give out.  Print the results from main().</p>
  
  <p>What is wrong with my program now. it compiles with no problems but my answer are wrong really wrong.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;conio.h&gt;
  
  //function prototype
  void change( int *d, int *q, int *di, int *n, int *p, int paid, int due );
  
  int main()
  {
      //variables
      int paid;
      int due;
      int dollars;
      int quarters;
      int dimes;
      int nickels;
      int pennies;
  
      //reference variables
      int *d;
      int *q;
      int *di;
      int *n;
      int *p;
  
      printf( "Enter amount due: \n" );
      scanf( "%d", &amp;due );
  
      printf( "Enter amount paid: \n" );
      scanf( "%d", &amp;paid );
  
      change( &amp;dollars, &amp;quarters, &amp;dimes, &amp;nickels, &amp;pennies, paid, due );
  
      printf( "Dollars = %d\nquarters = %d\ndimes =%d\nnickels = %d\npennies = %d", dollars, quarters, dimes, nickels, pennies );
  
      getch();
      return 0;
  }
  
  void change( int *d, int *q, int *di, int *n, int *p, int paid, int due )
  {
      int dm;
      int qm;
      int dim;
      int nm;
      int pm;
      int modu;
      int modu2;
      int modu3;
      int total;
      int penniestotal;
  
      total = due - paid;
  
      penniestotal = total * 100;
  
      dm = penniestotal / 100;
      modu = penniestotal % 100;
      qm = modu / 25;
      modu2 = modu % 25;
      dim = modu2 / 10;
      modu3 = modu2 % 10;
      nm = modu3 / 5;
      pm = modu3 % 5;
  }
  </code></pre>