Sail E0 Webinar
Question


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;
}
Options:
A .  Garbage Values
B .  2, 3, 3
C .  3, 2, 2
D .  0, 0, 0
Answer: Option D

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



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers