Chapter4
This commit is contained in:
17
DeitelC/Chapter4/sumAndAverage.c
Normal file
17
DeitelC/Chapter4/sumAndAverage.c
Normal file
@ -0,0 +1,17 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
int x = 0, counter = 0;
|
||||
scanf("%d", &x);
|
||||
|
||||
for(int t = 0; t < x; t++){
|
||||
int i;
|
||||
scanf("%d", &i);
|
||||
counter += i;
|
||||
}
|
||||
|
||||
printf("%d\n", counter/x);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user