Write a C program that will accept 10 input values and will store the values in array. The program will also identify and print the minimum, maximum and average of input values. NOTE: Your source code must display any of the given sample output below. It means your source code should be flexible enough to meet any of the given sample output. Your source code output must be identical to any of the given sample output. It means you have to strictly follow what are the displayed text, labels, casing of characters in the sample output. OUTPUT 1: Input Value 1: 50 Input Value 2: 20 Input Value 3: 35 Input Value 4: 100 Input Value 5: 75 Input Value 6: 89 Input Value 7: 5 Input Value 8: 11 Input Value 9: 85 Input Value 10: 60 MIN Value: 5 MAX Value: 100 AVG Value: 53 OUTPUT 2: Input Value 1: 10 Input Value 2: 9 Input Value 3: 8 Input Value 4: 7 Input Value 5: 6 Input Value 6: 5 Input Value 7: 4 Input Value 8: 3 Input Value 9: 2 Input Value 10: 1 MIN Value: 1 MAX Value: 10 AVG Value: 5 OUTPUT 3: Input Value 1: 50 Input Value 2: 20 Input Value 3: 35 Input Value 4: 94 Input Value 5: 75 Input Value 6: 89 Input Value 7: 1 Input Value 8: 11 Input Value 9: 85 Input Value 10: 60 MIN Value: 1 MAX Value: 94 AVG Value: 52

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
100%

Write a C program that will accept 10 input values and will store the values in array. The program will also identify and print the minimum, maximum and average of input values.

NOTE:
Your source code must display any of the given sample output below.
It means your source code should be flexible enough to meet any of the given sample output.
Your source code output must be identical to any of the given sample output.
It means you have to strictly follow what are the displayed text, labels, casing of characters in the sample output.
OUTPUT 1:
Input Value 1: 50
Input Value 2: 20
Input Value 3: 35
Input Value 4: 100
Input Value 5: 75
Input Value 6: 89
Input Value 7: 5
Input Value 8: 11
Input Value 9: 85
Input Value 10: 60
MIN Value: 5
MAX Value: 100
AVG Value: 53
OUTPUT 2:
Input Value 1: 10
Input Value 2: 9
Input Value 3: 8
Input Value 4: 7
Input Value 5: 6
Input Value 6: 5
Input Value 7: 4
Input Value 8: 3
Input Value 9: 2
Input Value 10: 1
MIN Value: 1
MAX Value: 10
AVG Value: 5
OUTPUT 3:
Input Value 1: 50
Input Value 2: 20
Input Value 3: 35
Input Value 4: 94
Input Value 5: 75
Input Value 6: 89
Input Value 7: 1
Input Value 8: 11
Input Value 9: 85
Input Value 10: 60
MIN Value: 1
MAX Value: 94
AVG Value: 52

Please help me how to fix this code! 

1.
#include <stdio.h>
Check 2 failed
2-
int main(){
Output:
3
int array[10];
int i;
int total = 0, avg, min, max;
4
Input Value 1:
5
6
Input Value 2:
7
Input Value 3:
for (i = 0; i < 10; i++){
printf("\nInput Value %d: ",i+l);
scanf("%d", &array[i]);
8-
Input Value 4:
9
10
Input Value 5:
11
Input Value 6:
12
total = total + array [i];
Input Value 7:
13
}
Input Value 8:
14
min = array[©];
Input Value 9:
15
16
max = array[0];
Input Value 10: MIN Value: 1
17
MAX Value: 10
for (i = 0; i < 10; i++){
if(min > array [i]){
min = array [i];
18 -
AVG Value: 5
19 -
20
Expected:
}
if(max < array[i]){
max = array[i];
21
Input Value 1:
22 -
Input Value 2:
23
24
Input Value 3:
25
}
Input Value 4:
26
Input Value 5:
printf("MIN Value: %d\n", min);
printf("MAX Value: %d\n", max);
printf("AVG Value: %d", total/10);
27
Input Value 6:
28
29
Input Value 7:
30
return 0;
Input Value 8:
31
}
Input Value 9:
Input Value 10:
MIN Value: 1
MAX Value: 10
MAVG Value: 5
Check 3 failed
Output:
Input Value 1:
Input Value 2:
Input Value 3:
Input Value 4:
Input Value 5:
Input Value 6:
Input Value 7:
Input Value 8:
Input Value 9:
Input Value 10: MIN Value: 1
MAX Value: 94
AVG Value: 52
87% (27:11)
Expected:
Codio
Project
File
Edit
Find
View
Tools
Education
Help
A Compile & Run -
> Project Index (static)
O Debug Current File
JANGELES8
task1.c
2. Task 1: Usi..
#include <stdio.h>
Input Value 1:
int main(){
Input Value 2:
3
Input Value 3:
int array[10];
int i;
int total = 0, avg, min, max;
4
Input Value 4:
6
Input Value 5:
7
Input Value 6:
for (i = 0; i < 10; i++){
printf("\nInput Value %d: ",i+l);
scanf("%d", &array[1]);
9
Input Value 7:
10
Input Value 8:
11
Input Value 9:
12
total = total + array [i];
Input Value 10:
13
14
MIN Value: 1
min = array[0];
max = array[0];
15
MAX Value: 10
16
MAVG Value: 5
17
Check 3 failed
18 -
19 -
for (i = 0; i < 10; i++){
if(min > array [1]){
min = array [i];
Output:
20
}
if (max < array [1]){
max = array[i];
}
21
Input Value 1:
22 -
23
Input Value 2:
24
Input Value 3:
25
Input Value 4:
26
Input Value 5:
printf("MIN Value: %d\n", min);
printf("MAX Value: %d\n", max);
printf("AVG Value: %d", total/10);
27
28
Input Value 6:
29
Input Value 7:
30
return 0;
}
Input Value 8:
31
Input Value 9:
Input Value 10: MIN Value: 1
MAX Value: 94
AVG Value: 52
Expected:
Input Value 1:
Input Value 2:
Input Value 3:
Input Value 4:
Input Value 5:
Input Value 6:
Input Value 7:
Input Value 8:
Input Value 9:
Input Value 10:
MIN Value: 1
MAX Value: 94
MAVG Value: 52
Show diff
87% (27:11)
Transcribed Image Text:1. #include <stdio.h> Check 2 failed 2- int main(){ Output: 3 int array[10]; int i; int total = 0, avg, min, max; 4 Input Value 1: 5 6 Input Value 2: 7 Input Value 3: for (i = 0; i < 10; i++){ printf("\nInput Value %d: ",i+l); scanf("%d", &array[i]); 8- Input Value 4: 9 10 Input Value 5: 11 Input Value 6: 12 total = total + array [i]; Input Value 7: 13 } Input Value 8: 14 min = array[©]; Input Value 9: 15 16 max = array[0]; Input Value 10: MIN Value: 1 17 MAX Value: 10 for (i = 0; i < 10; i++){ if(min > array [i]){ min = array [i]; 18 - AVG Value: 5 19 - 20 Expected: } if(max < array[i]){ max = array[i]; 21 Input Value 1: 22 - Input Value 2: 23 24 Input Value 3: 25 } Input Value 4: 26 Input Value 5: printf("MIN Value: %d\n", min); printf("MAX Value: %d\n", max); printf("AVG Value: %d", total/10); 27 Input Value 6: 28 29 Input Value 7: 30 return 0; Input Value 8: 31 } Input Value 9: Input Value 10: MIN Value: 1 MAX Value: 10 MAVG Value: 5 Check 3 failed Output: Input Value 1: Input Value 2: Input Value 3: Input Value 4: Input Value 5: Input Value 6: Input Value 7: Input Value 8: Input Value 9: Input Value 10: MIN Value: 1 MAX Value: 94 AVG Value: 52 87% (27:11) Expected: Codio Project File Edit Find View Tools Education Help A Compile & Run - > Project Index (static) O Debug Current File JANGELES8 task1.c 2. Task 1: Usi.. #include <stdio.h> Input Value 1: int main(){ Input Value 2: 3 Input Value 3: int array[10]; int i; int total = 0, avg, min, max; 4 Input Value 4: 6 Input Value 5: 7 Input Value 6: for (i = 0; i < 10; i++){ printf("\nInput Value %d: ",i+l); scanf("%d", &array[1]); 9 Input Value 7: 10 Input Value 8: 11 Input Value 9: 12 total = total + array [i]; Input Value 10: 13 14 MIN Value: 1 min = array[0]; max = array[0]; 15 MAX Value: 10 16 MAVG Value: 5 17 Check 3 failed 18 - 19 - for (i = 0; i < 10; i++){ if(min > array [1]){ min = array [i]; Output: 20 } if (max < array [1]){ max = array[i]; } 21 Input Value 1: 22 - 23 Input Value 2: 24 Input Value 3: 25 Input Value 4: 26 Input Value 5: printf("MIN Value: %d\n", min); printf("MAX Value: %d\n", max); printf("AVG Value: %d", total/10); 27 28 Input Value 6: 29 Input Value 7: 30 return 0; } Input Value 8: 31 Input Value 9: Input Value 10: MIN Value: 1 MAX Value: 94 AVG Value: 52 Expected: Input Value 1: Input Value 2: Input Value 3: Input Value 4: Input Value 5: Input Value 6: Input Value 7: Input Value 8: Input Value 9: Input Value 10: MIN Value: 1 MAX Value: 94 MAVG Value: 52 Show diff 87% (27:11)
Expert Solution
steps

Step by step

Solved in 3 steps with 6 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY