Computer Science, asked by muskansafdar908, 10 months ago

how to find a total of 5 marks and the average in Qbasic

Answers

Answered by HeAvEnPrlnCesS
0

\red{ANSWER}

/* C program to Find Total, Average, and Percentage of Five Subjects */

#include <stdio.h>

int main()

{

int english, chemistry, computers, physics, maths;

float Total, Average, Percentage;

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

scanf("%d%d%d%d%d", &english, &chemistry, &computers, &physics, &maths);

Total = english + chemistry + computers + physics + maths;

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;

}

Similar questions