Hello, hopefully someone will be able to help me.
"warning: assignment makes integer from pointer without a cast" is the error i get when i try to compile simple program that converts numer score into letter grade. What am I doing
wrong?
Thanks in advance,
Andriy
This is the code:
Code:#include <stdio.h> int main(void) { char grade; int get_score, num_score; /*get users input */ printf("Type in the numeric grade and press return> "); scanf("%lf", &num_score); /*converts the numeric score to letter grade*/ if(num_score > 89) grade = "A"; else if(num_score > 79) grade = "B"; else if(num_score > 69) grade = "C"; else if(num_score > 59) grade = "D"; else if(num_score < 58) grade = "F"; /*prints out the letter grade */ printf("Your score of %lf is a %c grade.\n", num_score, grade); return(0); }



LinkBack URL
About LinkBacks


