Home » C Programming » Declarations and Initializations

What is the output of the program #include int main() { int a[5] = {2, 3}; printf("%d, %d, %d\n", a[2], a[3], a[4]); return 0; }

Correct Answer: 0, 0, 0

Explanation:

When an automatic array is partially initialized, the remaining elements are initialized to 0.

← Previous Question Next Question→

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion