O.k dudes I've tried just about everything to get this crap to work anyways. I just got through failing a test this week that basically asked us to enter a numerical value and return a letter grade using user written function . I $$$$ing hate character values. I never can seem to get them to return a letter. I got this instead
enter a grade
98
the grade you entered is ♦
enter a grade
here is my code
can someone please help me figure this out why is it not giving me a letter value and a box instead. here is the code
#include <stdio.h>
char getletgrade(char);
int main()
{
int d;
char total;
do
{
printf("enter a grade\n");
scanf("%d", &d);
printf("the grade you entered is %c\n", total);
}
while (total !=999);
return 0;
}
char getletgrade(char c)
{
char A, B, C, D;
int grade;
if
(grade > 89)
c = 'A';
else if
(grade > 80 && grade < 89)
c = 'B';
else if
(grade > 70 && grade < 79)
c = 'C';
else if
(grade > 60 && grade < 69)
c = 'D';
else if
(grade < 60)
c = 'F';
return (c);
}