#include
void main ()
{
int x;
int mark=0;
int sum=0;
float average=0;
char ans;
do {
for ( x = 0; x <5 ; x++)
{
printf("Enter 5 mark \n");
scanf ( "%d",&mark);
sum=sum+mark;
average = sum/5;
}
if (average>=70)
printf ("Grade A \n");
else if (average>=60 && average <=69)
printf ("Grade B \n");
else if (average>=50 && average <=59)
printf ("Grade C \n");
else if (average>=40 && average <=49)
printf ("Grade D \n");
else if (average<=40)
printf ("Grade E \n");
mark=0;
sum=0;
average=0;
printf ("Do you wan to continue :D \n");
getchar();
scanf ("%c",&ans);
}while ( ans =='y' || ans == 'Y');
}
No comments:
Post a Comment