ExamVeda
Login
Home
This question belongs to C Program C Miscellaneous
C Miscellaneous
?

Determine Output:
void main()
{
      int i=0, j=0;
      if(i && j++)
            printf("%d..%d", i++, j);
      printf("%d..%d", i, j);
}

Answer & Solution
Correct Answer: Option C

The value of i is 0. Since this information is enough to determine the truth value of the boolean expression. So the statement following the if statement is not executed. The values of i and j remains unchanged and get printed.

Examveda
Question posted by Examveda
Community

Join the Discussion

1 Comment
Vasari Praveen
Vasari Praveen 7 years ago
j++ condition is checked so 0 and 1 should be printed .post incremental of j