GATEverse Practice, past papers & mock tests
GATE 2017 · CS2 - Afternoon
Programming & Data StructuresProgrammingeasyMCQ2 marks
Consider the C program fragment below:
c
while (r >= y) {
    r = r - y;
    q = q + 1;
}
Which of the following conditions on variables x, y, q and r before execution will ensure that the loop terminates in a state satisfying x == (y * q + r)?
Save your progress

Related Programming & Data Structures PYQs