|
|
Write a program to store and calculate the average percentage obtained by a class of 10 students. |
|
#include <stdio.h> int main(void) { float percent[10], avg, total; int i; for(total = i = 0 ; i <= 9; i++) { printf("\nPercentage %d :", i + 1); scanf("%f", &percent[i]); total += percent[i]; } avg = total / 10; printf("\nAverage percentage obtained is %f", avg); return 0; }
|
|
|
|
|
|
|
|