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.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.