Aggregate marks and percentage marks of student
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.
#include
#include
void main(void)
{
float s1,s2,s3,s4,s5,total,percent;
printf(“Enter the marks of subjects:”);
scanf(“%f%f%f%f%f”,&s1,&s2,&s3,&s4,&s5);
total=s1+s2+s3+s4+s5;
printf(“Your total marks out of 500 are %.2f”,total);
percent=((s1+s2+s3+s4+s5)/500)*100;
printf(“Your percentage is %.2f”,percent);
getch();
}
Comments
Post a Comment