Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- int main() {
- int num;
- scanf("%d", &num);
- if(num >= 0 && num <= 100) {
- if (num >= 90 && num <= 100) {
- printf("A\n");
- } else if (num >= 86 && num <= 89) {
- printf("A-\n");
- } else if (num >= 82 && num <= 85) {
- printf("B+\n");
- } else if (num >= 78 && num <= 81) {
- printf("B\n");
- } else if (num >= 74 && num <= 77) {
- printf("B-\n");
- } else if (num >= 70 && num <= 73) {
- printf("C+\n");
- } else if (num >= 66 && num <= 69) {
- printf("C\n");
- } else if (num >= 62 && num <= 65) {
- printf("C-\n");
- } else if (num >= 58 && num <= 61) {
- printf("D+\n");
- } else if (num >= 55 && num <= 57) {
- printf("D\n");
- } else {
- printf("F\n");
- }
- } else {
- printf("Wrong Input.\nEnter the number between 0 to 100.\n");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement