Given the following set of conditions determine the grade obtained by a student. i) if the percentage obtained is more than or equal to 60 then the grade given is A. ii) if the percentage obtained is between 50 and 60 then the grade given is B. iii) if the percentage obtained is between 40 and 50 then the grade given is C. iv) if the percentage obtained is less than 40 then the grade given is FAIL.

#include <stdio.h>

int main(void)
{
float percent;

printf( "\nEnter the percentage : " );
scanf("%f", &percent);


if(percent >= 60.0)
{
printf( "\nGrade A" );
}
else if(percent >= 50.0 && percent < 60.0)
{
printf( "\nGrade B" );
}
else if(percent >= 40.0 && percent < 50.0)
{
printf( "\nGrade C" );
}
else
{
printf( "\nFAIL" );
}


return 0;
}

No comments:

Post a Comment

kiss on google ads if you are anonymous because your ip is trackable.thank you.

......from.admin