Advertisement
Niloy007

Sakib's Problem 3

Dec 11th, 2020
492
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.81 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main() {
  5.     int num;
  6.     scanf("%d", &num);
  7.     if(num >= 0 && num <= 100) {
  8.         if (num >= 90 && num <= 100) {
  9.             printf("A\n");
  10.         } else if (num >= 86 && num <= 89) {
  11.             printf("A-\n");
  12.         } else if (num >= 82 && num <= 85) {
  13.             printf("B+\n");
  14.         } else if (num >= 78 && num <= 81) {
  15.             printf("B\n");
  16.         } else if (num >= 74 && num <= 77) {
  17.             printf("B-\n");
  18.         } else if (num >= 70 && num <= 73) {
  19.             printf("C+\n");
  20.         } else if (num >= 66 && num <= 69) {
  21.             printf("C\n");
  22.         } else if (num >= 62 && num <= 65) {
  23.             printf("C-\n");
  24.         } else if (num >= 58 && num <= 61) {
  25.             printf("D+\n");
  26.         } else if (num >= 55 && num <= 57) {
  27.             printf("D\n");
  28.         } else {
  29.             printf("F\n");
  30.         }
  31.     } else {
  32.         printf("Wrong Input.\nEnter the number between 0 to 100.\n");
  33.     }
  34. }
  35.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement