#include /* Prototypes */ char letter_grade(float score); /***************************************/ /* The program reads two values and */ /* generates the average. You need to */ /* provide two values separated by and */ /***************************************/ int main() { float score1 = 77, score2 = 88, avg; int values_read; /* Reading the values */ printf("Enter two scores using and format: "); values_read = scanf("%f and %f", &score1, &score2); printf("The number of values read is %d\n", values_read); /* Computing and printing the average */ avg = (score1 + score2) / 2; printf("Average for %f and %f is %.2f\n", score1, score2, avg); printf("Your letter grade is %c\n", letter_grade(avg)); return 0; } /******************************************/ /* letter_grade returns 'A; if score >=90 */ /* 'B' if score >=80, 'F' otherwise */ /******************************************/ char letter_grade(float score) { if (score >= 90) { return 'A'; } else if (score >= 80) { return 'B'; } else { return 'F'; } }