Marksheet in C-Language

#include<stdio.h> #include<conio.h> #include<stdlib.h> #include<string.h> main(){ system("color 97"); float eng, urdu, math, phy, chem, isl, pst, obtain, grand_total, per; char FName[25], LName[25], FFName[25], FLName[25], clas[25], sec[25]; printf("\n\n ---------------------------- MARK SHEET ----------------------------"); printf("\n\n Enter Canditate's First Name : "); scanf("%s" , &FName); printf("\n Enter Canditate's Last Name : "); scanf("%s" , &LName); printf("\n Enter Father's First Name : "); scanf("%s" , &FFName); printf("\n Enter Father's Last Name : "); scanf("%s" , &FLName); printf("\n Enter Class (in roman) : "); scanf("%s" , &clas); printf("\n Enter Section : "); scanf("%s" , &sec); system("cls"); printf("\n\n ---------------------------- MARK SHEET ----------------------------"); printf("\n\n Enter English Marks : "); scanf("%f" , &eng); if(eng > 100 || eng < 0){ printf("\n ERROR : Please Enter The Marks Between 0 - 100."); } else{ printf("\n Enter Urdu Marks : "); scanf("%f" , &urdu); if(urdu > 100 || urdu < 0){ printf("\n ERROR : Please Enter The Marks Between 0 - 100."); } else{ printf("\n Enter Maths Marks : "); scanf("%f" , &math); if(math > 100 || math < 0){ printf("\n ERROR : Please Enter The Marks Between 0 - 100."); } else{ printf("\n Enter Physics Marks : "); scanf("%f" , &phy); if(phy > 100 || phy < 0){ printf("\n ERROR : Please Enter The Marks Between 0 - 100."); } else{ printf("\n Enter Chemistry Marks : "); scanf("%f" , &chem); if(chem > 100 || chem < 0){ printf("\n ERROR : Please Enter The Marks Between 0 - 100."); } else{ printf("\n Enter Islamiat Marks : "); scanf("%f" , &isl); if(isl > 100 || isl < 0){ printf("\n ERROR : Please Enter The Marks Between 0 - 100."); } else{ printf("\n Enter Pak Studies Marks : "); scanf("%f" , &pst); if(pst > 100 || pst < 0){ printf("\n ERROR : Please Enter The Marks Between 0 - 100."); } else{ system("cls"); obtain = eng + urdu + math + phy + chem + isl + pst; grand_total = 600; per = obtain / grand_total * 100; printf("\n\n ---------------------------- MARK SHEET ----------------------------"); printf("\n\n Candidate's Name : %s %s Class : %s-%s " , FName, LName, clas, sec); printf("\n Father's Name : %s %s" , FFName, FLName); printf("\n\n Marks of English : %.2f " , eng); printf("\n\n Marks of Urdu : %.2f " , urdu); printf("\n\n Marks of Maths : %.2f " , math); printf("\n\n Marks of Physics : %.2f " , phy); printf("\n\n Marks of Chemistry : %.2f " , chem); printf("\n\n Marks of Islamiat : %.2f " , isl); printf("\n\n Marks of Pak Studies : %.2f " , pst); printf("\n\n Marks Obtained : %.2f " , obtain); printf("\n\n Grand Total : %.f " , grand_total); printf("\n\n -------------------------------------------------------------------"); printf("\n Percentage : %.2f%% " , per); printf("\n ---------------------------------------------------------------------"); if(per >= 80 && eng >= 35 && urdu >= 35 && math >= 35 && phy >= 35 && chem >= 35 && isl >= 35 && pst >= 35){ printf("\n\n Grade : A+(one)"); } else if(per >= 70 && eng >= 35 && urdu >= 35 && math >= 35 && phy >= 35 && chem >= 35 && isl >= 35 && pst >= 35){ printf("\n\n\t Grade : A"); } else if(per >= 60 && eng >= 35 && urdu >= 35 && math >= 35 && phy >= 35 && chem >= 35 && isl >= 35 && pst >= 35){ printf("\n\n\t Grade : B"); } else if(per >= 50 && eng >= 35 && urdu >= 35 && math >= 35 && phy >= 35 && chem >= 35 && isl >= 35 && pst >= 35){ printf("\n\n\t Grade : C"); } else if(per >= 35 && eng >= 35 && urdu >= 35 && math >= 35 && phy >= 35 && chem >= 35 && isl >= 35 && pst >= 35){ printf("\n\n\t Grade : D"); } else { printf("\n\n\t Grade : Fail"); } } } } } } } } getch(); }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.