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

Student Marks Calculation Report

The document is a C program that calculates student marks and generates a report using structures. It prompts the user to input the number of students and their respective roll numbers, names, and marks in three subjects. Finally, it calculates the total and average marks for each student and displays the results in a formatted output.

Uploaded by

VIJAYAKUMAR
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views2 pages

Student Marks Calculation Report

The document is a C program that calculates student marks and generates a report using structures. It prompts the user to input the number of students and their respective roll numbers, names, and marks in three subjects. Finally, it calculates the total and average marks for each student and displays the results in a formatted output.

Uploaded by

VIJAYAKUMAR
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd

/*calculating student marks & generate 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;
}

printf("\n________marks list is_________\n");


for(i=1;i<=n;i++)
{
printf("\n______________\n");
printf("\nrollno =>:%d",student[i].rollno);
printf("\nname =>:%s",student[i].name);
printf("\nmath marks =>:%d",student[i].maths);
printf("\nphy marks =>:%d",student[i].phy);
printf("\n comp marks =>:%d",student[i].comp);
printf("\n total =>:%d",student[i].total);
printf("\n average =>%f",student[i].avg);
printf("\n _______________________________\n");
}
getch();
}
output:
How Many Students: 2
enter 1 student rollno is: 101
enter the student name: raj
enter maths marks: 78
enter physics marks: 68
enter computer marks: 65
enter 2 student rollno is: 102
enter the student name: ram
enter maths marks: 89
enter physics marks: 79
enter computer marks: 64

________marks list is_________

rollno =>: 101


name =>:raj
maths marks =>: 78
physics marks =>: 68
computer marks =>: 65
total => :211
average =>70.333336
rollno =>: 102
name =>:ram
maths marks =>: 89
physics marks =>: 79
computer marks =>: 64
total => :232
average =>77.333336

You might also like