Gate2017 ss Q50

  • Option : C
  • Explanation :
    Given, program is:
    (while (r y){
    }
    If we want to final value as Then initial value of r should be equal to x (Since y is subtracted from r each time in given code). q incremented by 1 (q is quotient here). To avoid undefined behavior, value of y should be greater than zero. Therefore, (q == 0)&&(r == x)&&(y > 0))
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *