C Exercises: Accept a grade and display equivalent description
20. Grade to Description Mapping
Write a program in C to accept a grade and display the equivalent description:
Grade | Description |
---|---|
E | Excellent |
V | Very Good |
G | Good |
A | Average |
F | Fail |
Visual Presentation:
Sample Solution:
C Code:
Output:
Input the grade :A You have chosen : Average
Flowchart:
For more Practice: Solve these Related Problems:
- Write a C program to convert an input grade to its description, handling both uppercase and lowercase letters.
- Write a C program to accept multiple grades in one input and output their corresponding descriptions.
- Write a C program to map a grade to its description using a switch-case construct with error checking for invalid grades.
- Write a C program to convert a grade to its description using an array of strings and index mapping.
C Programming Code Editor:
Previous: Write a program in C to calculate and print the Electricity bill of a given customer.
Next: Write a program in C to read any day number in integer and display day name in the word.
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.