Q:

Write a program to print student marksheet

0

Write a program to print student marksheet

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Program;

// 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;

}

Output:

Enter your name: Komal Agarwl

Enter your Father name: Naval Gu Upta

Enter your Roll Number: HJDU1234

Enter your College name: Banasthali University, Jaipur

Enter your midterm marks for Chemistry: 1t 5
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: 122 
Enter your semester marks for Electrical & Electronics: 39

Enter your midterm marks for Machine Engineering: 19
Enter your semester marks for Machine Engineering: 50




		********************** YOUR RESULT *********************

		COLLEGE: Banasthali University, Jaipur
		NAME: Komal Agarwl		FATHER NAME: Naval GUpta
		ROLL NUMBER: HJDU1234
		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

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

C Programming Exercises With Solutions

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
Write a program to calculate simple interest... >>
<< Write a program to input from user (5 subjects) su...