Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

write a program that read a student score

0 votes
asked May 3, 2018 by anonymous
and print the student grade based on the ff grade system mark are rounded to the nearest integer use switch structure mark range 70-100 A 60-69 B 50-59 C 40-44 E 0-39 F

1 Answer

+1 vote
answered Jun 12, 2018 by Neela Charan Kumar (170 points)
#include<stdio.h>

struct student

{

int m1,m2,m3,m4;

}st;

int main()

{

int total,avg;

printf("enter 4 subject marks\n");

scanf(%d %d %d %d",&m1,&m2,&m3,&m4);

total=m1+m2+m3+m4;

avg=total/4;

if(avg>=70&&avg<=100)

printf("A GRADE");

if(avg>=60&&avg<=69)

printf("B GRADE");

if(avg>=50&&avg<=59)

printf("C GRADE");

if(avg>=40&&avg<=49)

printf("E GRADE");

if(avg>=0&&avg<=39)

printf("FAIL");
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...