Program To Accept Section-Wise Marks Of Students In One Subject And Then Display The Section-Wise Average Mark
/* Program To Accept Section-Wise Marks Of Students In One Subject And Then Display The Section-Wise Average Mark.Ensure That THE STRENGTH OF THE SECTION IS ATLEAST ONE NOT > 50.IGNORE INVALID MARKS ENTERED BY THE USER i.e. MARKS < 0 OR > 100 */ #include
#include
void main() { int i,j,nsec,sz,m,c=0,s=0; float avg; clrscr(); printf("\nEnter number of sections\n\n"); scanf("%d",&nsec); for(i=1;i<=nsec;i++) { printf("\nenter strength of section : %d\n",i); scanf("%d",&sz); if(sz,1||sz>50) { i--; continue; } for(j=1,s=0,c=0;j<=sz;j++) { printf("\nenter marks of student : %d of section : %d\n",j,i); scanf("%d",&m); if(m<0||m>100) continue; s = s+m; c++; } avg = (float)s/c; printf("\naverage marks of section : %d = %f",i,avg); } getch(); }
Please send comments to
vgdarur.javafive@blogger.com
Copyright © 2008 - iForeRunner.com
http://www.iforerunner.com/