C | Arrays | Question 10

Last Updated :
Discuss
Comments
Predict output of following program C
int main()
{
    int i;
    int arr[5] = {1};
    for (i = 0; i < 5; i++)
        printf("%d ", arr[i]);
    return 0;
}
1 followed by four garbage values
1 0 0 0 0
1 1 1 1 1
0 0 0 0 0
Tags:
Share your thoughts in the comments