To have 0% printed on the output, your code must have ended up here:
else {
printf("0%%");
}
You can easily verify this by printing out the value of Grades:
printf("Grades: %f\n", Grades);
You can see the value of Grades is 87.222221, hence your code does what it does.
Also, I think your code doesn't really work the way you'd like it to.
if (Grades <= 100 && Grades >= 98) {
printf("100%%");
}
else if (Grades <= 97 && Grades >= 95) {
printf("50%%");
}
else if (Grades <= 94 && Grades >= 92) {
printf("30%%");
}
else {
printf("0%%");
}
What happens for instance if Grades = 97.7? Well, it ends up printing 0.
I have a feeling what you really want would be better described by this piece of code:
float discount = 0.0f;
if (Grades <= 100.0f)
{
if (Grades >= 98.0f)
discount = 100.0f;
else if (Grades >= 95.0f)
discount = 50.0f;
else if (Grades >= 92.0f)
discount = 30.0f;
}
printf("%.2f%%", discount);