Why does this code return all the grades as F, and not A B C or D

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

#define N 10

int main(void)

{

int sum, numraise, studentname, i;
char score;
highscore=0.0;
sum=0.0;

for ( i=0 ; i<N ;i++ )

{

if (i >= 90.0)
score='A';
else if (i >= 80.0 && i< 90.0)
score='B';
else if (i >= 70.0 && i< 80.0)
score='C';
else if (i >= 60.0 && i< 70.0)
score='D';
else if (i < 60.0)
score='F';
}

average_score= sum/10;

for (studentname = 0; studentname < 10; studentname++)
{

dentname], score);
}
printf("The highest score is %.1lf\n", highscore);
printf("The average score is %.2lf\n", average_score);

return 0;
}```

Thank you!

2. Why is every grade returned an A?

3. Okay it's taking the last entered grade and using that to compute the letter grade for all the inputs, I see that much...

There is no point within your current loop (when N is defined as 10) where i is anything greater than 60.

Oh, and in the interest of flexibility/ease-of-change, you might want to change average = sum / 10 to average = sum / N. Otherwise, if you change N you will get the wrong average.

Also, you will probably want to change N to a less common name. I think that the C preprocessor will still replace defined constants if they are in the middle of a word. For example, if you had a variable called Number, it would give you a compiler error because it would replace the N with 10. I don't think this is actually an issue in this particular piece of code, but it's good practice.

See the real thread "need guidance on project", also by Lightyear, and up to page 5 already.