|This requires to use variables to hold the scores and the grade. If you are not allowed to use global variables you must declare them in your
main() function and pass them to the functions:
int score1, score2, score2;
ReadScores(&score1, &score2, &score3);
grade = GetGrade(score1, score2, score3);
I would read that in the sense of that it should not contain any operations but that variable declarations, assignment, and the mandatory return statement are allowed.
hoangtrungl wrote:The program's main is to contain only call statements.
After thinking about it a while I found a solution that does not use any variables in
ReadScores() must return a structure containing the data (which may be optionally dynamically allocated) that is passed to
GetGrade() (which can free allocated memory) which returns the grade that is passed to the
modified 23-Jun-17 5:49am.