PLEASE HELP!
- One of the grades is missing. Can you define it so the grade average will be 85?
#include
int main() {
/* TODO: define the grades variable here */
int average;
grades[0] = 80;
/* TODO: define the missing grade
so that the average will sum to 85. */
grades[2] = 90;
average = (grades[0] + grades[1] + grades[2]) / 3;
printf("The average of the 3 grades is: %d", average);
return 0;
}
Still Need Help?
Join the QuestionCove community and study together with friends!
Sign Up
OpenStudy (rsmith6559):
Check you array indexes carefully.
OpenStudy (cryocodex):
You just need to declare the int array variable like
/* TODO: define the grades variable here */
int grades[3];
Since it says the grade average must be 85 then we have that
/* TODO: define the missing grade
so that the average will sum to 85. */
grade[1] = 85;
Then it's all done we have (80+85+90) / 3 = 85