Pages

Monday, July 29, 2013

[H]. (c) 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.

void main()
{
int math, sci, sst, hin, eng, agg;
float percent;
printf("Maximum Marks In One Subjet Is 100.");
printf("\nEnter Marks Of Mathematics : ");
scanf("%d",&math);
printf("Enter Marks Of Science : ");
scanf("%d",&sci);
printf("Enter Marks Of Social Studies : ");
scanf("%d",&sst);
printf("Enter Marks Of Hindi : ");
scanf("%d",&hin);
printf("Enter Marks Of English : ");
scanf("%d",&eng);
agg=math+sci+sst+hin+eng;
percent=agg/5;
printf("Aggregate Marks = %d",agg);
printf("\nPercent = %f",percent);
getch();
}

No comments:

Post a Comment