63 103
Assignments Done
99%
Successfully Done
In July 2018

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.
Expert's answer
#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 first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions