Skip to content

Beta · Data may be lost.Your data may be reset or lost.

GateBrew
← GATE CSE 2017 Set 2
Questions

Q37

MCQ2 marks, −0.67Programming

Consider the C program fragment below which is meant to divide xx by yy using repeated subtractions. The variables xx, yy, qq and rr are all unsigned int.

while (r >= y) {
    r=r-y;
    q=q+1;
}

Which of the following conditions on the variables x,y,qx, y, q and rr before the execution of the fragment will ensure that the loop terminated in a state satisfying the condition x==(y∗q+r)x==(y*q + r)?

Sign in to save attempts.

Solutions and discussion are hidden while you attempt this question. They open once you check or show the answer.