title: return multiply argument from function
body: <p>i know that there exist similar question here but i  saw this algorithm   during these  days  and surprised how it is implemented.consider following function</p>
  
  <pre><code>int divide(int numerator, int denominator, int &amp;remainder) {
    remainder = numerator % denominator;
  return numerator / denominator;
  }
  </code></pre>
  
  <p>it is function implemented by references not by values itself
  and here is final code</p>
  
  <pre><code>int main() {
    int num = 14;
    int den = 4;
    int rem;
    int result = divide(num, den, rem);
    cout &lt;&lt; result &lt;&lt; "*" &lt;&lt; den &lt;&lt; "+" &lt;&lt; rem &lt;&lt; "=" &lt;&lt; num &lt;&lt; endl;
  </code></pre>
  
  <p>}
  result will be   written in comment  form</p>
  
  <pre><code>// 3*4+2=12
  </code></pre>
  
  <p>just my question is  while function returns one value from divide    function scope,how it can determine second or reminder term?please help me.it is token from MIT official site   .thanks a lot</p>