Write a c program for Calculation of aggregate and percentage marks
Problem Statement:
If the marks obtained by a student in five different subjects are input through the keyboard, find out the aggregate marks and percentage marks obtained by the student. Assume that the maximum marks that can be obtained by a student in each subject is 100.
Answer:
/* Calculation of aggregate and percentage marks */
#include<stdio.h>
#include<conio.h>
main()
{
int m1, m2, m3, m4, m5, aggr;
float per;
clrscr();
printf(“\n Enter marks in 5 subjects:”);
scanf(“%d %d %d %d %d”, &m1, &m2, &m3, &m4, &m5);
aggr=m1+m2+m3+m4+m5;
per=aggr/5;
printf(“\n Aggregate Marks=%d”,aggr);
printf(“\n Percentage Marks=%d”,per);
printf(“\n\n\n\n\n Press any key to exit….”);
getch();
}
Please run this program and share the output with us.