=[AD]=
Engineering Exams RRB-JE CS (Chemical Supervisor - Research) Technical Abilities 2025 22.04.25 Paper-2 Shift-2 Easy +1 -0.33
What will be the output of the following C code? #include void main() { int Array[5]={12,32,56,78}; printf("%d",Array[4]); }
Correct Answer: B. 0
Explanation: The output of the C code is 0 because the array is initialized with only four values despite having a defined size of five. In C, when an array is partially initialized, any remaining elements are automatically set to zero by the compiler. Since the code attempts to print the element at index 4, which is the fifth position in the array and was not explicitly assigned a value, it displays the default value of 0.
Click below to open Discussion & Feedback
0 Issues
Please login to comment or Report Issues.
Reported Issues
=[AD]=