Docsity

C Program to Calculate Grades based on Three Subjects, Exercises of Computer Engineering and Programming

Toggle sidebar
bg1
2
#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);
av=(sub1+sub2+sub3)/3;
if (av>=80)
{
printf ("The Grade is A\n");
}
if (av<80)
{
if (av>=50)
printf ("The Grade is B\n");
}
if (av<50)
{
if (av>=33)
printf ("The Grade is C\n");
}
if (av<33)
{
printf ("The Grade is D\n");
}
getch();
}
Grading
docsity.com

Partial preview of the text

Download C Program to Calculate Grades based on Three Subjects and more Exercises Computer Engineering and Programming in PDF only on Docsity!

#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