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;
}
Output-1

Enter the marks of five subjects:
25
53
75
85
63
Total Marks = 301.00
Average Marks = 60.20
Marks Percentage = 60.20
Output-2

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 




OUTPUT




  • Now Program End Without Any Error.
??? Learn Programming Languages Free In Our Website Coding With Harsh 
????? 5000+ Happy Visitor ?????
?? Free Programing Examples In Website Coding With Harsh 

  • If Any Query Regarding Programs, Website Or More Details Email Us On Contact@CodingWithHarsh.gq





Popular posts from this blog

C Program To Print Hello World

Declare And Initialize Two Character Constants And Output It To User

C Program To Calculate Profit Or Loss