C program to enter the marks of five subjects and award the grade accordingly

#include<stdio.h>
#include<conio.h>
void main()
{
float a,b,c,d,e,s;
puts("Enter marks of five subjects");
scanf("%f%f%f%f%f",&a,&b,&c,&d,&e);
s=(a+b+c+d+e)*100/500;
printf("Average marks = %.2f\n",s);
if(s>90)
puts("with A grade");
else if(s>80&&s<=90)
puts("with B grade");
else if(s>60&&s<=80)
puts("with C grade");
else
puts("with D grade");
}

Comments