Multiple choice technology programming languages

#include main() { char a[4]="HELLO"; printf("%s",a); }

  1. O

  2. H

  3. HELLO

  4. Compilation Error

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

The code attempts to initialize a 4-element character array with a 6-character string literal (5 characters + null terminator). In C, array initialization with an oversized string literal is a compilation error because the initializer exceeds the declared array size. While some compilers might allow this as an extension with a warning, standard C requires compilation error. The program cannot execute as written due to this initialization error.