If the marks obtained by a student in five different subjects are input through the keyboard, find out the aggreagte 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.
#include<stdio.h>
#include<conio.h>
main()
{
int m1,m2,m3,m4,m5,aggr;
float per;
printf("\nEnter 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("Aggregate Marks=%d",aggr);
printf("\nPercentage Marks=%f",per);
printf("\n\n\n\n\nEnter any for Exit....");
getch();
}
#include<stdio.h>
#include<conio.h>
main()
{
int m1,m2,m3,m4,m5,aggr;
float per;
printf("\nEnter 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("Aggregate Marks=%d",aggr);
printf("\nPercentage Marks=%f",per);
printf("\n\n\n\n\nEnter any for Exit....");
getch();
}
No comments:
Post a Comment