What is the output of the program?
int main()
{
int a[5] = {2, 3};
printf("%d, %d, %d", a[2], a[3], a[4]);
return 0;
}
Answers
Answered by
2
Explanation:
Programs require data to be input. This data is used (processed) by the program, and data (or information ) is output as a result.
Answered by
0
Answer:
The output will be 0,0,0
Explanation:
int a[5] = {2, 3};
- consider the above statement. Here integer array a[5] can store 5 integers but only two values have been provided.
- 2 will store in the 1st position of the array i.e. a[0]=2.
- 5 will store in the 2nd position of the array i.e. a[1]=5.
- As the values for 3rd , 4th and 5th position ( i.e. a[2],a[3],a[4]) have not been provided , they will store 0 by default.
- when we will try to print the 3rd,4th and 5th elements of the array using the statement printf("%d, %d, %d", a[2], a[3], a[4]), it will print 0 for each of these .
Similar questions
English,
6 hours ago
Computer Science,
11 hours ago
English,
8 months ago
Social Sciences,
8 months ago