If the marks obtained by a student in five different subject 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<stdio.h>
void main()
{
 int English,Hindi,Maths,Science,Sst ;//this goes in a single line.
 float Percentg ,avg;
 printf("\n English");
 scanf("%d",&English);
 printf("\n Hindi");
 scanf("%d",&Hindi);
 printf("\n Maths");
 scanf("%d",&Maths);
 printf("\n Science");
 scanf("%d",&Science);
 printf("\n Sst");
 scanf("%d",&Sst);
 avg=(English+Hindi+Maths+Science+Sst)/500.0;//this goes in a single line.
 printf("%f \n",avg);
 Percentg=avg*100;

 printf("%f",Percentg);
}


Post a Comment (0)
Previous Post Next Post