Program To Accept Marks Obtained By The Students In One Subject And Then Display The Section-Wise Average Mark
/* Program To Accept Marks Obtained By The Students In One Subject And Then Display The Section-Wise Average Mark */ #include
#include
void main() { int i,j,nsec,m,s=0,n; float avg; clrscr(); printf("\nEnter total number of sections\n\n"); scanf("%d",&nsec); for(i=0;i<=nsec;i++) { printf("\nenter number of students in section : %d\n",i+1); scanf("%d",&n); for(j=1;j<=n;j++) { printf("\nenter marks of student : %d of section : %d\n",j,i+1); scanf("%d",&m); s = s+m; } avg = (float)s/n; printf("\naverage mark of section : %d = %f\n",i+1,avg); } getch(); }
Please send comments to
vgdarur.javafive@blogger.com
Copyright © 2008 - iForeRunner.com
http://www.iforerunner.com/