Marksheet program in C
In this article, you will learn about the marksheet program in C with its output.
What is a marks sheet?
- A marksheet is a formal document that thoroughly records a student's academic performance and achievements in a certain course, examination, or educational program.
- Detailed information is often included, including the student's name, ID number, course or program name, courses or modules taken, grades or marks received, and any extra notes or examination board comments.
- Marksheets are extensively used in educational institutions, including schools, colleges, and universities, to analyze and convey students' progress and performance.
- They serve as a physical representation of a student's academic accomplishments. They are typically necessary for numerous objectives, such as applying for further school, seeking work, or participating in future educational possibilities.
Now let us look at the example:
Code:
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main()
{
//declaring Variables
int rollno,english,hindi,maths,science,social,computer;
char name[30];
char result[10];
char grade;
//declaring sum variable for sum of marks
int sum;
//taking rollno
printf("Enter your Roll No:");
scanf("%d", &rollno);
//taking name
printf("Enter your name:");
scanf(" %s", name);
//english marks
printf("Enter marks of english:");
scanf("%d", &english);
//hindi marks
printf("Enter marks of hindi:");
scanf("%d", &hindi);
//maths marks
printf("Enter marks of maths:");
scanf("%d", &maths);
//science marks
printf("Enter marks of science:");
scanf("%d", &science);
//social marks
printf("Enter marks of social:");
scanf("%d", &social);
//computer marks
printf("Enter marks of computer:");
scanf("%d", &computer);
//calculating sum of marks
sum=english+hindi+maths+science+social+computer;
//grading according to sum value
if(sum>=500)
{
grade='A';
}
else if(sum>=400 && sum<500)
{
grade='B';
}
else if(sum>=300 && sum<400)
{
grade='C';
}
else if(sum>=200 && sum<300)
{
grade='D';
}
else
{
grade='F';
}
if(sum<200)
{
strcpy(result,"fail");
}
else
{
strcpy(result,"pass");
}
//printing output
printf(“===================================================\n");
printf("Roll No.: %d Student Name: %s\n", rollno, name);
printf(“---------------------------------------------------\n");
printf(“SUBJECT\t\t\tMARKS\n");
printf(“---------------------------------------------------\n");
printf("English\t\t\t %d \n", english);
printf("Hindi\t\t\t %d \n", hindi);
printf("Maths\t\t\t %d \n", maths);
printf("Science\t\t\t %d \n", science);
printf("Science\t\t\t %d \n", social);
printf("Computer\t\t %d \n", computer);
printf(“---------------------------------------------------\n");
printf("Total Marks:\t\t%d\t\tgrade:%c\t\tResult:%s\n",sum,grade,result);
printf("===================================================\n");
return 0;
}
Output:
![Marksheet program in C](https://static.tutorialandexample.com/c/marksheet-program-in-c1.png)