This program demonstrates the use of the if-else statement to write the following program.
The program can also be materialized by using either logical operators or the elseif statement.
The marks obtained by a student in 5 different subjects are input through the keyboard.
The student gets a division as per the following rules:
Percentage above or equal to 60 - First Division
Percentage between 50 and 59 -- Second Division
Percentage between 40 and 49 --- Third Division
Percentage less than 40 ---- Fail
Write a program to calculate the division obtained by the student.
int m1, m2, m3, m4, m5, per;
printf ("Enter marks in five subjects:");
scanf ("%d %d %d %d %d", &m1, &m2, &m3, &m4, &m5);
printf ("First Division\n");
printf ("Second Division\n");
printf ("Third Division\n");
The file can also be found at: