GATEverse
← GATE CSE 2017 Set 2

Q37

MCQ2 marks, −0.67

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.

Loading…