Current location - Training Enrollment Network - Mathematics courses - Calculate the sum and average of 50 students' English and math scores with C language array
Calculate the sum and average of 50 students' English and math scores with C language array
# include & ltstdio.h & gt

int main(){

int i,j;

float s=0.0,ave = 0.0

Floating a [50] [2];

for(I = 0; I & lt50; i++)

for(j = 0; j & lt2; j++)

scanf("%f ",& ampa[I][j]);

for(I = 0; I & lt50; i++)

s+= a[I][0];

ave = s/50;

Printf ("sum and average of English scores of 50 students %f, %f", s, ave);

for(I = 0; I & lt50; i++)

s+= a[I][ 1];

ave = s/50;

Printf ("total math score and average of 50 students %f, %f", s, ave);

Returns 0;

}