Curioustab
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Home
»
C Programming
»
Declarations and Initializations
What is the output of the program #include<stdio.h> int main() { int a[5] = {2, 3}; printf("%d, %d, %d\n", a[2], a[3], a[4]); return 0; }
Garbage Values
2, 3, 3
3, 2, 2
0, 0, 0
Show Answer
Correct Answer:
0, 0, 0
Explanation:
When an automatic array is partially initialized, the remaining elements are initialized to 0.
← Previous
Next →
Discussion & Comments
No comments yet. Be the first to comment!
Name:
Comment:
Post Comment