Student Marks Calculation Report
Student Marks Calculation Report
using structures*/
#include<stdio.h>
void main()
{
struct marks
{
char name[30];
int rollno,maths,phy,comp,total;
float avg;
}
student[10];
int i,n;
clrscr();
printf("\nhow Many Students:");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
printf("enter %d student rollno is:",i);
scanf("%d",&student[i].rollno);
printf("enter the student name:");
scanf("%s",&student[i].name);
printf("enter maths marks:");
scanf("%d",&student[i].maths);
printf("enter physics marks:");
scanf("%d",&student[i].phy);
printf("enter computer marks:");
scanf("%d",&student[i].comp);
}
clrscr();
for(i=1;i<=n;i++)
student[i].total=student[i].maths
+student[i].phy
+student[i].comp;
student[i].avg=(float)student[i].total/3;
}