Student Marksheet Program in C Programming Languagage

In this tutorial, we are going to make a simple student mark sheet or mark list program in C programming language. using this program a student can enter their Name, Roll Number, University Name, Father's Name, and marks of their university exam. After that based upon the marks, the program can print the mark sheet of the student that he fails or pass.

Student Marksheet Program in C Programming Languagage

Introduction to C [Student Marksheet] program

To understand this project you should have basic knowledge of C programming. such as how an array of string works and how to take input and print the data from the string array in C programming.

If you are a beginner in C programming then this is a useful project for you. you can either modify this program or use it in your project. also, my suggestion is that you first try to create this project on your own and if you are stuck at any point then you can use my code for reference or help.

// C Program to print the student mark sheet

#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


Output


Conditions/Logic for a student to pass the exam

To pass the university exam a student needs to have at least a total of 44 number or marks in all particular subjects including midterm marks and semester marks.

Also if a student has 0 marks in the midterm exam and 44 marks in the semester exam then also a student passes the particular subject exam.

Example


Condition/logic for a student to fail in the exam

If a student does not have at least 44 marks in any one subject then he fails. so we need to print the fail in the program.

Example


Explanation of program

Here in the above program first we define the subjects String array in which we define the subject names and then we define a subcode String array that consists of subject codes, and then we define the two empty integer array mid marks and semarks and two int variables count and MTotal and initialize its values to zero.

After that, we are taking the input from the user name, fname, number, and college using the gets method(we can also use the scanf function for taking input but scanf does not take white spaces in a string). After that using for loop we are taking the input for the subject marks and storing them in the midmarks and semmarks integer array.

After that using the printf method we are print the college name, student name, his father's name, and his roll number. Then, we are printing the subject code, midterm marks, semester marks, and a total number of marks in a separate line using for loop as you could see in the given above image.

By using the count variable we are finding that if there is any subject for which the total number of marks is less than 44 then we print the FAIL message on the screen. otherwise, we print the PASS message on the screen.

Post a Comment

2 Comments

  1. Your blog is very valuable which you have shared here about C Programming Assignment Help I appreciate the efforts which you have put into this blog and also it is a gainful blog for us. Thank you for sharing this here.

    ReplyDelete
  2. You have a genuine capacity to compose a substance that is useful for us. You have shared an amazing blog about excel assignments thanks for sharing this blog with us.

    ReplyDelete