-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnine.c
More file actions
31 lines (21 loc) · 751 Bytes
/
nine.c
File metadata and controls
31 lines (21 loc) · 751 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
// Program to find out result of student (five subjects).
#include<stdio.h>
int main() {
int hindi, english, math, science, computer, total;
float percentage;
printf("Enter number of hindi sub - ");
scanf("%d", &hindi);
printf("Enter number of english sub - ");
scanf("%d", &english);
printf("Enter number of math sub - ");
scanf("%d", &math);
printf("Enter number of science sub - ");
scanf("%d", &science);
printf("Enter number of computer sub - ");
scanf("%d", &computer);
total = hindi + english + math + science + computer;
percentage = ((float)total * 100.00)/ 500.00;
printf("Total Marks - %d/500\n", total);
printf("Your Percentage - %.2f", percentage);
return 0;
}