return multiply argument from function
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

    int divide(int numerator, int denominator, int &remainder) {
      remainder = numerator % denominator;
    return numerator / denominator;
    }
it is function implemented by references not by values itself
and here is final code

    int main() {
      int num = 14;
      int den = 4;
      int rem;
      int result = divide(num, den, rem);
      cout << result << "*" << den << "+" << rem << "=" << num << endl;
}
result will be   written in comment  form

    // 3*4+2=12
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
return multiply argument from function
===

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

    int divide(int numerator, int denominator, int &remainder) {
      remainder = numerator % denominator;
    return numerator / denominator;
    }
it is function implemented by references not by values itself
and here is final code

    int main() {
      int num = 14;
      int den = 4;
      int rem;
      int result = divide(num, den, rem);
      cout << result << "*" << den << "+" << rem << "=" << num << endl;
}
result will be   written in comment  form

    // 3*4+2=12
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