Multiple choice technology programming languages

What is the output ?main(){ int a[5]={1,2,3,4,5}; a[7] = 23; printf("%d", a[7]);}

  1. 23

  2. Garbage Value

  3. 0

  4. Compilation-Array out of boundary

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

In the C language, compiler specifications do not enforce array boundary checks. Writing to a[7] translates to modifying the memory offset corresponding to that index, and subsequently printing it retrieves the assigned value of 23 without causing a compilation or runtime error.