/*------------------------------------------------------------------*/ /* testquorembad.c */ /* Author: Bob Dondero */ /* The need for call by reference. */ /*------------------------------------------------------------------*/ #include /*------------------------------------------------------------------*/ static int quorem(int iDividend, int iDivisor, int iRemainder) /* Divide iDividend by iDivisor. Assign the remainder to iRemainder, and return the quotient. */ { iRemainder = iDividend % iDivisor; return iDividend / iDivisor; } /*------------------------------------------------------------------*/ int main(void) /* Test the quorem function. Return 0. */ { int iQuo; int iRem; iQuo = quorem(11, 3, iRem); printf("Quotient: %d Remainder: %d\n", iQuo, iRem); return 0; } /* Sample Execution: $ testquorembad Quotient: 3 Remainder: 1108551892 */