GATE Computer Science (CS) 2017 Shift 2 Solved Paper

© examsiri.com
Question : 47 of 65
 
Marks: +1, -0
Consider the C program fragment below which is meant to divide x by y using repeated subtraction. The variables x, y, q and r are all unsigned int.
While (r >= y) {
r = r – y;
q = q + 1;
}
Which of the following conditions on the variables x, y, q and r before the execution of the fragment will ensure that the loop terminates in a state satisfying the condition x == (y*q + r)?
Go to Question: