#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();
}

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; floatadd; 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(); }