Consider the C program fragment below which is meant to divide \(x\) by \(y\)…
GATE · 2017 · CS · Set 2 · Computer Science & IT
Consider the C program fragment below which is meant to divide by using repeated subtractions. The variables and are all unsigned int.
while (r >= y) { r=r-y; q=q+1; }
Which of the following conditions on the variables and before the execution of the fragment will ensure that the loop terminated in a state satisfying the condition ?
- A.
- B.
- C.
- D.
Attempted by 396 students.
Sign up free to check your answer
Sign up freeLoading lesson…