Add letter-grade.c

This commit is contained in:
BBaoVanC 2020-10-20 19:30:51 -05:00
parent e776910e71
commit bd022c5f22
No known key found for this signature in database
GPG Key ID: 6D74C8B0E7D791C2

23
letter-grade.c Normal file
View File

@ -0,0 +1,23 @@
#include <stdio.h>
int main() {
int input;
scanf("%i", &input);
printf("Your input was: %i\n", input);
char letter;
if ((input/10) >= 9) {
letter = 'A';
} else if ((input/10) >= 8) {
letter = 'B';
} else if ((input/10) >= 7) {
letter = 'C';
} else if ((input/10) >= 6) {
letter = 'D';
} else {
letter = 'F';
}
printf("Your letter grade is %c\n", letter);
return 0;
}