program to find the average of 10 students 's marks in array in c language.
#include<stdio.h>
#include<conio.h>
void main()
{
int marks[10],i,sum=0;
float avg;
clrscr();
printf("enter the marks of math subject of 10 students=");
for(i=0; i<10; i++)
{
scanf("%d",&marks[i]);
}
for(i=0; i<10; i++)
{
sum=sum+marks[i];
}
avg=sum/10;
printf("the average of marks is=%f",avg);
getch();
}
■》 Output->
enter the marks of math subject of 10 students=
23
70
90
99
98
65
48
83
74
79
the average of marks is=72.000000
Comments
Post a Comment