Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Consider a function division () that computes the quotient and the remainder of

ID: 3775083 • Letter: C

Question

Consider a function division() that computes the quotient and the remainder of two positive integer parameters, a and b:

    void division(int a, int b, int *quotient, int *remainder) {

        line A

        line B

    }

The function is incomplete. What are the correct lines of code that should replace line A and line B ?

*quotient = a / b;

*remainder = a % b;

*quotient = a / b;

*remainder = a # b;

*quotient = a / b;

remainder = a % b;

quotient = a / b;

remainder = a % b;

*quotient = a / b;

*remainder = a % b;

*quotient = a / b;

*remainder = a # b;

*quotient = a / b;

remainder = a % b;

quotient = a / b;

remainder = a % b;

Explanation / Answer

Answer:

Below two lines should replace lineA and B

*quotient = a / b;

*remainder = a % b;

since quotient and remainder are pointer variables, we have to assigne a value to these variables in the form of pointer variable representation only. So we should use "*" astrick in front of these two variables.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote