Answer is (C) $3,2$
First $2$ variable integer type declared named $i$ and $j$
Then int type array $a[8]$ declared and initialized.
$a[0] = 1 , a[1] = 2, a[2] = 3, a[3] = 4, a[4] = 5, a[5] = 6, a[6] = 7,a[7] = 8$
Then for loop started
$i=0 , i<3$ (true)
$a[0]=a[0]+1 = 1+1=2$
$i++$ (outside for loop) , $i++$ (inside for loop);
$i=2 ,i<3$ (true)
$a[2]=a[2]+1 = 3+1=4 $
$ i++, i++$(outside for loop) ,
$i=4, i<3$ (false) //Now come out of loop
$i-- ;$ (so $i=3$)
Now another for loop started where in loop integer type variable named i declared
Block Scope: A Block is a set of statements enclosed within left and right braces ({ and } respectively). Blocks may be nested in C (a block may contain other blocks inside it). A variable declared in a block is accessible in the block and all inner blocks of that block, but not accessible outside the block.
What if the inner block itself has one variable with the same name?
If an inner block declares a variable with the same name as the variable declared by the outer block, then the visibility of the outer block variable ends at the point of declaration by inner block.
So here inner block int i has the scope in this block only and outer block int i visibility is not allowed in that block
$j=7 , j>4$(true)
int $i = 7/2=3$
$a[3]=a[3]-1=4-1=3$
$j=6 , j>4$ (true)
int $i = 6/2=3$
$a[3]=a[3]-1=3-1=2$
$j=5 , j>4$ (true)
int $i = 5/2=2$
$a[2]=a[2]-1=4-1=3$
$j=4 , j>4$ (false)
Now when the for loop ends its variable named $i$ scope is also end and the outer block variable now visible. So, in printf outer variable $i$ is used.
So, the output would be: $3,2$.