190. C Program to Read Marks of Student and give the class.
How does this program work?
- This Program is used to read marks of student and give the class.
Here is the code
int main(void)
{
int t,e,h,m,sc,so,tot;
float avg;
printf("Enter Telugu marks:\n");
scanf("%d",&t);
printf("Enter English marks:\n");
scanf("%d",&e);
printf("Enter hindi marks:\n");
scanf("%d",&h);
printf("Enter Maths marks:\n");
scanf("%d",&m);
printf("Enter Science marks:\n");
scanf("%d",&sc);
printf("Enter social marks:\n");
scanf("%d",&so);
tot=t+e+h+m+sc+so;
avg=tot/6;
printf("Total Marks obtained = %d\n",tot);
printf("average=%.2f\n",avg);
if(t<35||e<35||h<35||m<35||sc<35||so<35)
{
printf("Fail\n");
}
else
if(avg>=35&&avg<50)
{
printf("III class\n");
}
else
if(avg>=50&&avg<60)
{
printf("II class\n");
}
else
if(avg>=60&&avg<75)
{
printf("I class\n");
}
else
printf("Distinction");
}