#include(stdio.h)
main()
{
int score;
char grade;
printf("please input a score\n");
scanf("%d",&score);
grade=score>=90?'A'score>=60?'B':'C');
printf("%d belongs to %c",score,grade);
}
Q,E,D I don't know which row is wrong, please help and I am novice.
There are a couple of problems with line 8:
- You have an unbalanced parenthises.
- You're missing the colon in the first ternary opeator
It should be: grade=score>=90?'A' : (score>=60?'B':'C');
PLEASE USE CODE TAGS (the <> formatting button) when posting code.