#include
#include
void main()
{
int a,b,c,d,total,per;
clrscr();
printf("enter the marks in 5 subject:\n");
printf("\nmaths=");
scanf("%d",&a);
printf("\nscience=");
scanf("%d",&b);
printf("\njava=");
printf("\nc++=");
scanf("%d",&c);
printf("\nasp.net=");
scanf("%d",&d);
total=a+b+c+d;
per=total/4;
printf("\ntotal=%d",total);
printf("\npercentage=%d",per);
if(per>=90)
{
printf("\n A grade");
}
else if(per>80)
{
printf("\n B grade");
}
else if(per>70)
{
printf("\n C grade");
}
else if (per>60)
{
printf("\n D grade");
}
else if (per>50)
{
printf("\n E grade");
}
if(per>=40)
{
printf("\npass class");
}
else if(per<=40)
{
printf("\n fail");
}
getch();
}
0 comments:
Post a Comment