#include<stdio.h>
void main()
{
struct stud
{
char n[15];
int r,m[3],t;
float a;
}s[10];
int i,j,p;
printf("\n\tSTUDENT MARKLIST");
printf("\nEnter the no. of students:");
scanf("%d",&p);
for(i=0;i<p;i++)
{
printf("\nEnter the details of student%d:",i+1);
printf("\nName:");
scanf("%s",s[i].n);
printf("\nRoll no.:");
scanf("%d",&s[i].r);
for(j=0;j<3;j++)
{
printf("\nMark%d:",j+1);
scanf("%d",&s[i].m[j]);
}
s[i].t=s[i].m[0]+s[i].m[1]+s[i].m[2];
s[i].a=(float)s[i].t/3;
}
printf("\n STUDENT MARKLIST");
printf("\n|Name           |Roll no.|Mark1|Mark2|Mark3|Total|Average|");
for(i=0;i<p;i++)
{
printf("\n|%-15s|%-8d|%-5d|%-5d|%-5d|%-5d|%-7.1f|",s[i].n,s[i].r,s[i].m[0],s[i].m[1],s[i].m[2],s[i].t,s[i].a);
}
}





Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: