C Program to Find the Sum and Average of Student
#include<stdio.h>
#include<conio.h>
void main()
{
float m1,m2,m3,avg;
int grade;
printf("Enter the marks\n");
scanf("%f%f%f",&m1,&m2,&m3);
avg=(m1+m2+m3)/3;
printf("Average = %f\n",avg);
if(avg>=85)
grade=1;
else if(avg>=70)
grade=2;
else if(avg>=60)
grade=3;
else if(avg>=50)
grade=4;
else if(avg>=40)
grade=5;
else
grade=6;
switch(grade)
{
case 1:
printf("grade is A");
break;
case 2:
printf("grade is B");
break;
case 3:
printf("grade is C");
break;
case 4:
printf("grade is D");
case 5:
printf("grade is E");
break;
case 6:
printf("FAIL");
break;
}
getch();
}