-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path5-sub-marks-division.c
More file actions
31 lines (27 loc) · 898 Bytes
/
5-sub-marks-division.c
File metadata and controls
31 lines (27 loc) · 898 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <stdio.h>
void main()
{
float obtained, total=500, percentage;
int stdNumber, phys, chem, bio, math, comp;
char name[20];
printf("Enter Your Name: ");
scanf("%s", name);
printf("Enter Your Studient Number: ");
scanf("%d", &stdNumber);
printf("Enter Marks in Sequence(physics,Chemistry,Biology,Math,Computer): ");
scanf("%d%d%d%d%d", &phys, &chem, &bio, &math, &comp);
obtained = phys + chem + bio + math + comp;
percentage = (obtained * 100) / total;
printf("\nStudient Name: %s\n", name);
printf("Studient Number: %d\n", stdNumber);
printf("Obtained Marks: %.0f\n", obtained);
printf("Percentage: %.1f%c\n", percentage, 37);
if(percentage > 60)
puts("Division: 1st");
else if((percentage >= 50)&&(percentage < 60))
puts("Division: 2nd");
else if((percentage >= 40)&&(percentage < 50))
puts("Division: 3rd");
else if(percentage < 40)
puts("Remarks: Fail");
}