CP DML Q35

0. Consider the following program fragment
if (a>b)
  printf("a>b");
else
  printf("else part");
  printf("a<=b");
a<=b will be printed if

  • Option : D
  • Explanation :
    The else clause has no brackets i.e., { and }. This means the else clause is made up of only one statement.
    So, printf(" a < = b") will be executed anyway, i.e. if a > b or a <= b. Hence the answer.
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 *