divide is a function that takes four arguments and returns no value. The first two arguments are of type int. The last two arguments arguments are pointers to int that are set by the function to the quotient and remainder of dividing the first argument by the second argument. The function does not return a value. x and y are two int variables that have been declared and initialized. q and r are two int variables that have been declared. Write a statement that sets the value of q to the quotient of x divided by y , and sets the value of r to the remainder of x divided by y, by calling divide.

LANGUAGE: C++

CHALLENGE:

divide is a function that takes four arguments and returns no value. The first two arguments are of type int. The last two arguments arguments are pointers to int that are set by the function to the quotient and remainder of dividing the first argument by the second argument. The function does not return a value. x and y are two int variables that have been declared and initialized. q and r are two int variables that have been declared. Write a statement that sets the value of q to the quotient of x divided by y , and sets the value of r to the remainder of x divided by y, by calling divide.

SOLUTION:



divide ( x,y, &q, &r);