sum average min max in c array
#include <stdio.h>
int main(){
int i,sum=0;
//declaring array
int score[7] = {67,55,98,88,90,76,89};
//finding sum of the array numbers
for(i = 0; i < 7; i++){
sum = sum + score[i];
}
printf("Sum is %dn",sum);
//finding average
printf("Average is %dn",sum/7);
//finding max number
int max=score[0];
for(i = 0; i < 7; i++){
if(score[i] > max){
max = score[i];
}
}
printf("Max number is %dn",max);
//finding min number
int min=score[0];
for(i = 0; i < 7; i++){
if(score[i] < min){
min=score[i];
}
}
printf("MIn number is %dn",min);
return 0;
}