Student marksheet program in c – In this post, we are going to make a Program in C Programming that will print the Marksheet of a Student. as an input program will take the user given data like his name, father’s name, student roll number, college name, and his midterm and semester marks for all subjects. and then it will print on the output screen in a proper mark sheet form as you can see in the below-given image.
Note: You can modify this program with your subject codes and subject names.
Student Marksheet Program In C
#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
int main()
{
char subjects[6][25] = {"Chemistry", "C Programming", "Mathematics", "Environment", "Electrical & Electronics", "Machine Engineering"};
char subjcode[6][7] = {"CH-102", "CS-102", "MA-111", "CS-107", "EE-101", "ME-101"};
int midmarks[6],semmarks[6], i=0;
int MTotal = 0,count = 0;
char name[30], fname[30], rno[10], college[50];
printf("Enter your name: ");
gets(name);
printf("\nEnter your Father name: ");
gets(fname);
printf("\nEnter your Roll Number: ");
gets(rno);
printf("\nEnter your College name: ");
gets(college);
for(i=0; i<6; i++)
{
printf("\nEnter your midterm marks for %s: ", subjects + i);
scanf("%d",&midmarks[i]);
printf("Enter your semester marks for %s: ", subjects + i);
scanf("%d",&semmarks[i]);
}
printf("\n\n\n\n\t\t********************** YOUR RESULT *********************\n\n");
printf("\t\tCOLLEGE: %s", college);
printf("\n\t\tNAME: %s\t\tFATHER NAME: %s", name, fname);
printf("\n\t\tROLL NUMBER: %s", rno);
printf("\n\t\tSUBJECTS \t Marks1 \t Marks2 \t TOTAL");
for(i = 0; i < 6; i++)
{
printf("\n\t");
printf("\t%s \t\t %d \t\t %d \t\t %d",subjcode[i], midmarks[i], semmarks[i], midmarks[i] + semmarks[i]);
MTotal = MTotal + midmarks[i] + semmarks[i];
if (midmarks[i] + semmarks[i] < 44)
count = count + 1;
}
if (count == 0)
printf("\n\n\t\tTOTAL MARKS: %d \t\tRESULT: PASS", MTotal);
else
printf("\n\n\t\tTOTAL MARKS: %d \t\tRESULT: FAIL", MTotal);
return 0;
}
Input
Enter your name: Ram Sharma
Enter your Father name: Shayam Sharma
Enter your Roll Number: DHU123
Enter your college name: delhi high university, Delhi
Enter your midterm marks for Chemistry: 15
Enter your semester marks for Chemistry: 40
Enter your midterm marks for C programming: 12
Enter your semester marks for C programming: 36
Enter your midterm marks for Mathematics: 16
Enter your semester marks for Mathematics: 48
Enter your midterm marks for Environment: 20
Enter your semester marks for Environment: 49
Enter your midterm marks for Electrical & Electronics: 12
Enter your semester marks for Electrical & Electronics: 39
Enter your midterm marks for Machine Engineering: 19
Enter your semester marks for Machine Engineering: 50
Output
***************** YOUR RESULT ******************
COLLEGE: delhi high university, Delhi
NAME: Ram Sharma FATHER NAME: Shayam Sharma
ROLL NUMBER: DHU123
SUBJECTS Marks1 Marks2 TOTAL
CH-102 15 40 55
CS-102 12 36 48
MA-111 16 48 64
CS-107 20 49 69
EE-101 12 39 51
ME-101 19 50 69
TOTAL MARKS: 356 RESULT: PASS