The program below is the division of marks scored by a student in 5 different subjects.Here the marks are entered by the user and the percentage is first calculated and then depending on the percentage scored the division is alloted to the student

```
/*we assume total marks is 500*/
#include<stdio.h>
int main()
{
float m1,m2,m3,m4,m5,avg,per; //m=marks
printf("Enter 5 subject marks: ");
scanf("%f %f %f %f %f",&m1,&m2,&m3,&m4,&m5);
per = (m1+m2+m3+m4+m5)*100/500;
printf("Student get %0.2f percentage. n",per);
if(per>=60)
printf("1st Division");
else if(per>=50 && per<=59)
printf("2nd Division");
else if(per>=40 && per<=49)
printf("3rd Division");
else if(per<40)
printf("Fail");
return 0;
}
```

This article is written by **plus2net.com** team.

Swapping two numbers sample code
Average of two numbers as entered by user
Highest of three numbers
Finding exam Grade of mark entered using if else condition
Calculation of user entered numbers
Percentage of Mark
Division of Mark
Digits in Number
Sum of Digits
Matrix Multiplication

sadiya ramesh | 13-07-2014 |

help me out with this please Write a C program that prompts for students’ final grades in 5 units in a given class (the grades are integer values in the range 0-100). The program then displays the class grade average, the highest grade, and how many students in the class failed the course (a grade less than 40 is a failing grade). If a student fails in more than 2 subjects then a message “DISCONTINUATION” is displayed at the very end. |