if the answer is 90 through 100 it displays an A if the number is between 80 and 89 it will Display a B, but if its any number less then that it wont work. what am i missing?

``````if((int) total >= 90 && total <= 100) {
}
else if((int) total >= 80 && total <= 89) {
}
else if((int) total >= 70 && total <= 79) {
}
else if((int) total >= 60 && total <= 69) {
}
else if((int) total <= 59) {
printf("You have Failed with a %d percent \n");
}

return 0;``````

First question, what do you hope to gain by casting this?

``if((int) total >= 90 && total <= 100)``

First question, what do you hope to gain by casting this?

``if((int) total >= 90 && total <= 100)``

Can you clarify, what you mean, when you ask, "what do you hope to gain"
there's a printf statement right below it if you didnt read that.

Please look at the code below

``````#include <stdio.h>

int main()
{
int total = 60;

if((total >= 90) && (total <= 100))
{
}
else if((total >= 80) && (total <= 89))
{
}
else if((total >= 70) && (total <= 79))
{
printf("%c \n", gradeLetter3);/*c% should be %c*/
}
else if((total >= 60) && (total <= 69))
{
printf("%c \n", gradeLetter4);/*c% should be %c*/
}
else if(total <= 59)
{
printf("You have Failed with a %d percent \n", total);
}
return 0;
}``````

or better

``````#include <stdio.h>

int main()
{
int total = 55;

if(total >= 90)
{
}
else if(total >= 80)
{
}
else if(total >= 70)
{
printf("%c \n", gradeLetter3);/*c% should be %c*/
}
else if(total >= 60)
{
printf("%c \n", gradeLetter4);/*c% should be %c*/
}
else if(total <= 59)
{
printf("You have Failed with a %d percent \n", total);
}
return 0;
}``````

dude i didnt even realize my percent sign was backwards wow thanks btw i have all the chars declared i just didnt show me whole code, but thanks man

``````int grade = 87;
char letter[6] = "FDCBAA";

int main(void)
{