Multiple choice

What would be the output of the following C code? int i=1, j=1; int n = 1; if(n>0){i++;j--;}printf(i=%d, j=%d,i, j);

  1. i=0 j=0

  2. i=2 j=2

  3. i=2 j=0

  4. i =1 j=1

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

This is the correct answer as the condition specified in the if statement is satisfied. Therefore, the value of i is incremented by 1, and value of j is decremented by 1.