student class tests

#include"stdio.h"
#include"conio.h"

void main()
{
int marks[40][4];
float avg_mrk[4];
int sum,min_mrk;

printf("Enter class test marks: \n");

for(int i=0;i<40;++i)
{
printf("serial No %d :\n",i+1);
for(int j=0;j<4;j++)
{
scanf("%d",&marks[i][j]);
}
sum=0;
min_mrk=marks[i][0];
for(j=0;j<4;j++)
{
sum=sum+marks[i][j];
if(min_mrk>marks[i][j])
min_mrk=marks[i][j];
}
avg_mrk[i]=float(sum-min_mrk)/3;
}
printf("Average marks : \n");
for(i=0;i<40;i++)
{
printf("serial No %d :\t",i+1);
printf("%.2f: \n ",avg_mrk[i]);
}


}

/* OUTPUT
Enter class test marks:
serial No 1 :
17 18 19 17
serial No 2 :
18 18 19 17
serial No 3 :
18 16 15 13
serial No 4 :
10 08 19 20
..........
serial No 40 :
18 18 19 17
Average marks :
serial No 1 : 18.00:
serial No 2 : 18.33:
serial No 3 : 16.33:
serial No 4 : 16.33:
..................
serial No 40 : 18.33:




*/

No comments:

Post a Comment

There was an error in this gadget

Followers

About Me

Dhaka, Dhaka, Bangladesh
..