Multiple choice technology programming languages

6) void abc(int a[]) { a++; a[1] = 612; } main() { char a[5]; abc(a); printf(“%d”,a[4]); }

  1. error

  2. arbitary value

  3. 612

  4. 100

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

The function signature void abc(int a[]) decays the parameter to a pointer, so a++ increments the local pointer. However, in main(), a is declared as char a[5], and passing it to abc expects an int pointer (int*), causing a type mismatch error or compilation issue in strict C compilation contexts. Additionally, type mismatch between char array and int function parameter triggers a compilation error.