Answer:
// code to declare and read grade
#include <stdio.h>
// main function
int main(void) {
// if grade is character
char grade;
printf("Enter your grade:");
// read grade from user
scanf("%c",&grade);
// print grade
printf("your grade is:%c",grade);
return 0;
}
Step-by-step explanation:
Declare a char variable "grade" to store your grade in the class.If the grade is numeric then we can Declare it as either "double grade;" or "int grade;". To read a value, scanf() function is used from stdio.h.Read a grade from user and assign it to variable "grade".
Output:
Enter your grade:B
your grade is:B