Computer Science, asked by inaayaqasim, 1 month ago

Write a program to input marks of English, Maths and Science. Find its total and percentage.​

Answers

Answered by pratyush1493
1

Answer:

#include <stdio.h>

int main()

{

float eng, phy, chem, math, comp;

float total, average, percentage;

/* Input marks of all five subjects */

printf("Enter marks of five subjects: \n");

scanf("%f%f%f%f%f", &eng, &phy, &chem, &math, &comp);

/* Calculate total, average and percentage */

total = eng + phy + chem + math + comp;

average = total / 5.0;

percentage = (total / 500.0) * 100;

/* Print all results */

printf("Total marks = %.2f\n", total);

printf("Average marks = %.2f\n", average);

printf("Percentage = %.2f", percentage);

return 0;

}

I Hope this answer is helpful and please mark me as brainliest.

Similar questions