Multiple choice technology programming languages

void main() { int a[2][3]={{1,2,3},{4,5,6}}; printf("%d\n",++**(a+1)); }

  1. 5

  2. garbage value

  3. compile error

  4. 2

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

The expression ++(a+1) breaks down as: (a+1) points to the second row {4,5,6}, (a+1) gives the address of the first element of that row, *(a+1) dereferences to get the value 4, and ++ pre-increments it to 5 before printf uses it. The array is modified, and 5 is printed.