What is the output of C Program.? int main() { int a[]; a[4] = {1,2,3,4}; printf("%d", a[0]); } *
D) Compiler error
A) 1
C) 4
B) 2
Answers
Answered by
16
Answer:
1 is the answer
and mark me brainly
Answered by
0
What is the output of C Program.? int main() { int a[]; a[4] = {1,2,3,4}; printf("%d", a[0]); }
A) 1
C) 4
B) 2
D) Compiler error
The output of the program is 1 (Option A)
- This program has been done in C language.
- The above program starts with making an integer type a and placing 1,2,3, and 4 making it an array.
- Now array works by starting its index count from 0 in the case of the C program.
- So at 0 positions, 1 is present. That means a[0] is equal to 1.
- Similarly, a[1] is equal to 2, a[2] is equal to 3, and so on.
- Thus the output of the above program after printing in the console is 1.
#SPJ2
Similar questions
Computer Science,
2 months ago
Math,
2 months ago
History,
2 months ago
Science,
4 months ago
Math,
4 months ago
Physics,
10 months ago
Physics,
10 months ago
Political Science,
10 months ago