#include <stdio.h>
int main()
{
int ma, ch, ph, en, st,tot;
float avg;
printf("\nEnter the 5 marks \n");
scanf("%d%d%d%d%d", &ma, &ch, &ph, &en, &st);
tot = ma + ch + ph + en + st;
avg = tot/5;
printf("\nTotal : %d", tot);
printf("\nAvearge : %f", avg);
if(avg>=50&&avg<=60)
{
printf("\nGrade D");
}
else if (avg>60&&avg<=70)
{
printf("\nGrade C");
}
else if (avg>70&&avg<=90)
{
printf("\nGrade B");
}
else if (avg>90&&avg<=100)
{
printf("\nGrade A");
}
else
{
printf("\nFail!");
}
return 0;
}
Comments
Post a Comment