Answer to Question #71247 in C++ for wawan

Question #71247
A student’s letter grade is calculated according to the following schedule:


Numerical Grade Letter Grade
Greater than or equal to 90 A
Less than 90 but greater than or equal to 80 B
Less than 80 but greater than or equal to 70 C
Less than 70 but greater than or equal to 60 D
Less than 60 F


Using this information, write C program that accepts a student’s numerical grade, converts the numerical grade to an equivalent letter grade and displays he letter grade.
1
Expert's answer
2017-11-23T06:25:07-0500
#include <stdio.h>


int main(void)
{
/* numerical grade */
int n;
/* letter grade */
char l;

printf("Enter numerical grade: ");
scanf("%d", &n);

if (n>=90)
l = 'A';
else if (n>=80)
l = 'B';
else if (n>=70)
l = 'C';
else if (n>=60)
l = 'D';
else
l = 'F';

printf("Letter grade: %c\n", l);
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS