What is the output of the following code? int a[5]={1,2,3,4,5}; int total=D0.j; for (j-0;j<5;j++){ total+=a[j]; printf("The total is %d",total/5); O 2 3 O 4 1.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter11: Inheritance And Composition
Section: Chapter Questions
Problem 28SA
icon
Related questions
Question
100%
Language is C
What is the output of the following code?
int a[5]=[1,2,3,4,5};
int total=0.j;
for (j-0;j<5;j++){
total+=alj];
printf("The total is %d", total/5);
3.
Previous
Transcribed Image Text:What is the output of the following code? int a[5]=[1,2,3,4,5}; int total=0.j; for (j-0;j<5;j++){ total+=alj]; printf("The total is %d", total/5); 3. Previous
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning