73,460 views
44 votes
44 votes
Write the definition of a function divide 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 and 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.

User Demnogonis
by
3.1k points

1 Answer

19 votes
19 votes

void divide (int x, int y, int*q, int*r)

{

*q = x / y;

*r = x % y;

}

User Vit Khudenko
by
3.1k points