0% found this document useful (0 votes)
3 views2 pages

Student Marks Management Program

This C program defines a structure called "student" to store details of 10 students such as roll number, name, marks in 3 subjects, total marks and average. It takes input from the user, calculates total and average for each student and prints the details.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views2 pages

Student Marks Management Program

This C program defines a structure called "student" to store details of 10 students such as roll number, name, marks in 3 subjects, total marks and average. It takes input from the user, calculates total and average for each student and prints the details.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd

/* simple program using structures*/

#include<stdio.h>
#include<conio.h>
struct student
{
int sno;
char sname[10];
int sub1;
int sub2;
int sub3;
int tot;
float avg;
}s[10];
void main()
{
int i,j,tot;
clrscr();
printf("enter sno,names and the marks\n");
for(i=0;i<10;i++)
{
scanf("%d %s %d %d
%d",&s[i].sno,s[i].sname,&s[i].sub1,&s[i].sub2,&s[i].sub3);
tot=0;
s[i].tot=s[i].tot+s[i].sub1+s[i].sub2+s[i].sub3;
s[i].avg=s[i].tot/3.0;
}
printf("rollno\tname\tsub1\tsub2\tsub3\ttotal\taverage");
for(i=0;i<10;i++)
{
printf("%d %s %d %d %d %d
%f\n",s[i].sno,s[i].sname,s[i].sub1,s[i].sub2,s[i].sub3,s[i].tot,s[i].avg
);
}
getch();

You might also like