ProgrammingVery hard
int a[5] = {[2] = 7, 9}; printf("%d", a[3]); What is printed?
- A. 7
- B. 0
- C. 2
- D. 9
Correct answer: D. 9
After the designator sets a[2] = 7, the next initialiser without a designator goes to the following element, a[3].
More C Programming questions
- char s = "hi"; s++; printf("%s", s); What is printed?
- int x = 1; { int x = 2; printf("%d", x); } printf("%d", x); What is printed?
- printf("%d", (int)'A' + 'x01'); What is printed?
- for (char c = 'z'; c > 'w'; c--) putchar(c); What is printed?
- printf("%d", sizeof(void ) == sizeof(int )); What is printed?
- int a[3]; int p = a; printf("%d", p + 3 > a); What is printed?