PROGRAM:-
#include<stdio.h>
void main()
{
int i,j,sum=0,num;
int marks[100];
float avg;
printf("Enter number of students in class :\n");
scanf("%d",&num);
printf("Enter marks of all students :\n");
for(i=0;i<num;i++)
{
scanf("%d",&marks[i]);
sum+=marks[i];
}
avg=sum/num;
printf("Average of class is %f\n",avg);
}
OUTPUT :-
Enter number of students in class :
10
Enter marks of all students :
50 60 65 70 80 35 48 90 88 78
Average of class is 66.000000
Program File:(click the following .c file to get the program file)
Excellent 🎉
ReplyDelete