Need help on a simple c program. Writing a TestValue program. The program runs but doesn’t return a letter grade.
This is what I have so far.
#include <stdio.h>
int main()
{
double testValue;
char getGrade;
printf("Enter your score between o and 100:");
scanf("%if", &testValue);
printf("Your grade is %c\n", getGrade);
return 1;
}
char getGrade(double value)
{
if(value>=90)
return'A';
else if(value>=80)
return'B';
else if(value>=70)
return'C';
else if(value>=60)
return'D';
else if(value>=50)
return'F';
return 1;
}
%ifShould be%lfYou have not called the
getGradefunctionYou have two identifiers with the same name.
Remove the
char getGrade;declaration and just call thegetGradefunction.