#include <stdio.h>

/**

* Code to work out average of results from 10 students entered

*/

int main(){

/*

result and sum can be float etc for more precision since

if results can be .25 and sum could be a decimal result as a result

*/

int counter, result[10], sum;

double avg; // double for precision

//For loop to enter scores for 10 students, and work out sum on each pass

for(counter = 0; counter < 10; counter++){

printf("Please enter result for student %d: ", counter+1);

scanf("%d", &result[counter+1]);

//sum = current sum value + value in array

sum +=result[counter+1];

}

avg = (double)sum / (double)10; //typecast for precision. Not required necessarily

printf("Average result is %f", avg);

return 0;

}