$ x==(y∗q+r)$
I don't think it is hard to make an intuitive guess here that
x = number to be divided.
y = divisor.
q = quotient.
r = remainder.
Option A says set quotient == remainder in the beginning. It doesn't serve any good to division.
Option B says x > 0. Why? We can legally divide 0 by anything. So, if x === 0, division should have no issues.
Option C says set quotient == 0, remainder == number to be divided, and divisor > 0.
So far so good.
Trace out the code. (Keep $451 == 10 * 45 + 1$ in mind)
- In each subtraction, we're reducing the size of remainder by divisor. That's technically what happens with each division.
- Every time we successfully subtract, quotient increments. Good.
This Option is correct.
Option D doesn't specify for remainder == number to be divided in the beginning of the program, but division by repeated subtraction wants that.