
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
This c program calculates and assigns a letter grade (a, b, c, or d) based on the average of marks obtained in three subjects. The user is prompted to enter the marks of each subject using the scanf function.
Typology: Exercises
1 / 1
This page cannot be seen from the preview
Don't miss anything!

#include<stdio.h> #include<conio.h> void main (void) { int sub1,sub2,sub3,av; printf ("\n\nPlease enter the marks of three subjects\n"); scanf ("%d%d%d",&sub1,&sub2,&sub3); if (av>=80) av=(sub1+sub2+sub3)/3; { printf ("The Grade is A\n"); }^2 if (av<80) if (av<50) if (av<33) getch(); } { if (av>=50) printf ("The Grade is B\n"); } { if (av>=33) printf ("The Grade is C\n"); } { printf ("The Grade is D\n"); }^ Grading docsity.com