title: void function Math error
body: <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  
  void compute_coins(int change, int quarters, int dimes, int nickels, int pennies);
  void output(int quarters, int dimes, int nickels, int pennies);
  
  int main()
  {
    int change, quarters, dimes, nickels, pennies;
    char again = 'y';
  
    cout &lt;&lt; "Welcome to the change dispenser!\n";
  
    while(again == 'y'){//Creating loop to allow the user to repeat the process
      cout &lt;&lt; "Please enter the amount of cents that you have given between 1 and 99\n";
      cin &gt;&gt; change;
      while((change &lt; 0) || (change &gt;100)){//Making a loop to make sure a valid number is             inputed
          cout &lt;&lt; "Error: Sorry you have entered a invalid number, please try again:";
          cin &gt;&gt; change;
      }
      cout &lt;&lt; change &lt;&lt; " Cents can be given as: " &lt;&lt; endl;
      compute_coins(change, quarters, dimes, nickels, pennies);
      output(quarters, dimes, nickels, pennies);
  
      cout &lt;&lt; "Would you like to enter more change into the change dispenser?  y/n\n";//prompts the user to repeat this process
      cin &gt;&gt; again;
    }
    return 0;
  }
  
  
  void compute_coins(int change, int quarters, int dimes, int nickels, int pennies) {//calculation to find out the amount of change given for the amount inpuied
      using namespace std;
      quarters = change / 25;
      change = change % 25;
      dimes = change / 10;
      change = change % 10;
      nickels = change / 5;
      change = change % 5;
      pennies = change;
      return ;
  }
  
  void output(int quarters, int dimes, int nickels, int pennies){
    using namespace std;
    cout &lt;&lt; "Quarters = " &lt;&lt; quarters &lt;&lt; endl;
    cout &lt;&lt; "dimes = " &lt;&lt; dimes &lt;&lt; endl;
    cout &lt;&lt; "nickels = " &lt;&lt; nickels &lt;&lt; endl;
    cout &lt;&lt; "pennies = " &lt;&lt; pennies &lt;&lt; endl;
  }
  </code></pre>
  
  <p>Sorry the code didn't transfer well and I'm pretty new to this site still. But, I am getting crazy numbers for the outcome on the quarters, dimes, nickels, and pennies. I did this once already and it worked fine but I didn't use void functions, so I had to redo it and I messed myself up and I'm stuck. any help appreciated! </p>