0% found this document useful (0 votes)
10 views

C Language Result

The document is a C program that calculates the total marks, obtained marks, and percentage for various subjects including English, Urdu, Math, Chemistry, Physics, Pakistan Studies, Islamiat, and Biology or Computer. It then assigns a grade based on the calculated percentage. The program runs in an infinite loop, prompting the user for input repeatedly.

Uploaded by

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

C Language Result

The document is a C program that calculates the total marks, obtained marks, and percentage for various subjects including English, Urdu, Math, Chemistry, Physics, Pakistan Studies, Islamiat, and Biology or Computer. It then assigns a grade based on the calculated percentage. The program runs in an infinite loop, prompting the user for input repeatedly.

Uploaded by

mrckbjxspace
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

1: #include<stdio.

h>
2: #include<conio.h>
3: #include<math.h>
4: int main()
5: {
6: while(true)
7:
8: {
9: int etm, utm, mtm, ctm, ptm, p_sttm, itm, bctm, tm;
10: float emo, umo, mmo, cmo, pmo, p_stmo, imo, bcmo, mo;
11: printf("\nEnglish");
12: printf("\nEnter English Marks Obtained= ");
13: scanf("%f", &emo);
14: printf("\nEnter English Total Marks= ");
15: scanf("%d", &etm);
16: //abc
17: printf("\nUrdu");
18: printf("\nEnter Urdu Marks Obtained= ");
19: scanf("%f", &umo);
20: printf("\nEnter Urdu Total Marks= ");
21: scanf("%d", &utm);
22: //abc
23: printf("\nMath");
24: printf("\nEnter Math Marks Obtained= ");
25: scanf("%f", &mmo);
26: printf("\nEnter Math Total Marks= ");
27: scanf("%d", &mtm);
28: //abc
29: printf("\nChemistry");
30: printf("\nEnter Chemistry Marks Obtained= ");
31: scanf("%f", &cmo);
32: printf("\nEnter Chemistry Total Marks= ");
33: scanf("%d", &ctm);
34: //abc
35: printf("\nPhysics");
36: printf("\nEnter Physics Marks Obtained= ");
37: scanf("%f", &pmo);
38: printf("\nEnter Physics Total Marks= ");
39: scanf("%d", &ptm);
40: //abc
41: printf("\nPakistan Studies");
42: printf("\nEnter Pakistan Studies Marks Obtained= ");
43: scanf("%f", &p_stmo);
44: printf("\nEnter Pakistan Studies Total Marks= ");
45: scanf("%d", &p_sttm);
46: //abc
47: printf("\nIslamiat");
48: printf("\nEnter Islamiat Marks Obtained= ");
49: scanf("%f", &imo);
50: printf("\nEnter Islamiat Total Marks= ");
51: scanf("%d", &itm);
52: //abc
53: printf("\nBiology or Computer");
54: printf("\nEnter Biology or Computer Marks Obtained= ");
55: scanf("%f", &bcmo);
56: printf("\nEnter Biology or Computer Total Marks= ");
57: scanf("%d", &bctm);
58: //abc
59: mo=emo+umo+mmo+cmo+pmo+p_stmo+imo+bcmo;
60: tm=etm+utm+mtm+ctm+ptm+p_sttm+itm+bctm;
61: printf("\nThe Total Marks are= %d", tm);
62: printf("\nThe Marks Obtained are= %f", mo);
63: //abc
64: float pers;
65: pers=mo*100/tm;
66: printf("\nThe Persentage is= %f", pers);
67: //abc
68: char grade;
69: int a=2;
70: if((pers>=95)&&(pers<=100))
71: {
72: printf("\nGrade: AA\nExcellent Keep it up %c", a);
73: }
74: //abc
75: else if((pers>=79)&&(pers<95))
76: {
77: printf("\nGrade: A\nVery Good Keep it Up%c", a);
78: }
79: //abc
80: else if((pers>=69)&&(pers<79))
81: {
82: printf("\nGrade: B\nGood Come on! You can do it");
83: }
84: //abc
85: else if((pers>=59)&&(pers<69))
86: {
87: printf("\nGrade: C\nSatisfactory Need more Efforts");
88: }
89: //abc
90: else if((pers>=50)&&(pers<59))
91: {
92: printf("\nGrade: D\nPoor");
93: }
94: //abc
95: else
96: {
97: printf("\nGrade: F Fail\nFail Do Hard Work for the Next T
98: }
99: printf("\n\n\n");
100:
101: }
102: }

You might also like