C Program To Find Total, Average And Percentage Of Five Subjects
C Program To Find Total, Average And Percentage Of Five Subjects
In this example, you will learn to Find Total, Average And Percentage Of Five Subjects
Example :
Enter the marks of five subjects:
75
85
85
75
90
Total Marks = 410.00
Average Marks = 82.00
Marks Percentage = 82.00
How Program Works ??
- Input marks from user. Store it in variable.
- Then Count Total Marks.
- Then Count Average Marks.
- Then Count Percentage.
- Show Below Program For More Easy Understand.
Logic ??
Count Total Marks, Average And Percentage Of Five Subjects
Code For "Find Total, Average And Percentage Of Five Subjects".
/* Author --> HARSH PATEL */
#include <stdio.h>
int main()
{
int sub1, sub2, sub3, sub4, sub5;
float Total, Average, Percentage;
printf("Enter the marks of five subjects: \n");
scanf("%d%d%d%d%d", &sub1, &sub2, &sub3, &sub4, &sub5);
Total = sub1 + sub2 + sub3 + sub4 + sub5;
Average = Total / 5;
Percentage = (Total / 500) * 100;
printf("Total Marks = %.2f\n", Total);
printf("Average Marks = %.2f\n", Average);
printf("Marks Percentage = %.2f", Percentage);
return 0;
}
Enter the marks of five subjects:
25
53
75
85
63
Total Marks = 301.00
Average Marks = 60.20
Marks Percentage = 60.20
Enter the marks of five subjects:
75
85
85
75
90
Total Marks = 410.00
Average Marks = 82.00
Marks Percentage = 82.00
😊 Some Image Of Program To Find area of rectangle
- Now Program End Without Any Error.
![???](https://fonts.gstatic.com/s/e/notoemoji/14.0/1f5a5_fe0f/32.png)
![?????](https://fonts.gstatic.com/s/e/notoemoji/14.0/1f468_200d_1f393/32.png)
![?????](https://fonts.gstatic.com/s/e/notoemoji/14.0/1f469_200d_1f393/32.png)