Program to find Grade of student
#include<stdio.h>
void main()
{
int Sum,Hin,Eng,Math,Science,Sst;
float per;
printf("\nEnter Marks Hindi ");
scanf("%d",&Hin);
printf("\nEnter Marks English");
scanf("%d",&Eng);
printf("\nEnter Marks Maths");
scanf("%d",&Math);
printf("\nEnter Marks Science");
scanf("%d",&Science);
printf("\nEnter Marks Social Science");
scanf("%d",&Sst);
Sum=(Hin+Eng+Math+Science+Sst);
per=(float)Sum/500*100;
printf("\nPercentage :%f",per);
if(per>=90)
printf("\n Grade A");
else if(per>=80)
printf("\n Grade B");
else if(per>=70)
printf("\n Grade C");
else if (per>=60)
printf("\n Grade D");
else if (per>=40)
printf("\n Grade E");
else
printf("\n Fail");
}
void main()
{
int Sum,Hin,Eng,Math,Science,Sst;
float per;
printf("\nEnter Marks Hindi ");
scanf("%d",&Hin);
printf("\nEnter Marks English");
scanf("%d",&Eng);
printf("\nEnter Marks Maths");
scanf("%d",&Math);
printf("\nEnter Marks Science");
scanf("%d",&Science);
printf("\nEnter Marks Social Science");
scanf("%d",&Sst);
Sum=(Hin+Eng+Math+Science+Sst);
per=(float)Sum/500*100;
printf("\nPercentage :%f",per);
if(per>=90)
printf("\n Grade A");
else if(per>=80)
printf("\n Grade B");
else if(per>=70)
printf("\n Grade C");
else if (per>=60)
printf("\n Grade D");
else if (per>=40)
printf("\n Grade E");
else
printf("\n Fail");
}
Comments
Post a Comment