66.7 65.2 71.5 67.4 81.3
72.6 70.4 80.3 76.3 74.1
75.1 77.5 64.3 62.7 69.5
75.3 75.1 75.2 79.4 72.3
Above table is Engineering students marks in year wise
a) Find year wise average marks
b) Total marks along with average
c) Find each students aggregate.
1. #include<stdio.h>
#include<conio.h>
main()
{
int s[5][5],sum[7][7];
int i,j=1,sums=0,l=1,num;
float add;
clrscr();
printf("Enter no of students required");
scanf("%d",&num);
for(l=1;l<=num;l++)
{
printf("enter the marks of the %d student",l);
for(i=1;i<=4;i++)
{
sums=0;
printf("in the %d year",i);
for(j=1;j<=5;j++)
{
scanf("%d",&s[i][j]);
sums+=s[i][j];
}
if(l==1)
sum[l][i]=sums;
else if(l==2)
sum[l][i]=sums;
else if(l==3)
sum[l][i]=sums;
else if(l==4)
sum[l][i]=sums;
}
}
for(l=1;l<=num;l++)
{
for(i=1;i<=4;i++)
{
printf("Marks of the %d student in the %d year is %d and average is
%dn",l,i,sum[l][i],(sum[l][i]/4));
}
}
for(l=1;l<=num;l++)
{
for(i=1;i<=4;i++)
{
add=(float)(sum[l][i]);
}
printf("Aggregate of the %d student is %fn",l,(add/4));
}
getch();
}