Input
Enter marks of five subjects: 95 76 85 90 89
Output
Total = 435
Average = 87
Percentage = 87.00
Process:
- Input marks of five subjects.
- Store into variables like eng, phy, chem, math and comp.
- total = eng + phy + chem + math + comp.
- average = total / 5.
- percentage = (total / 500) * 100.
- Print resultant values total, average and percentage
#include <stdio.h>
int main()
{
float eng, phy, chem, math, comp;
float total, average, percentage;
printf("Enter marks of five subjects : \n");
scanf("%f%f%f%f%f", &eng, &phy, &chem, &math, &comp);
total = eng + phy + chem + math + comp;
average = total / 5.0;
percentage = (total / 500.0) * 100;
printf("Total = %f\n", total);
printf("Average = %f\n", average);
printf("Percentage = %f", percentage);
return 0;
}