Advertisement
semsem_elazazy

practical 15

Dec 29th, 2021
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.51 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.   float x;
  6.   printf("Enter your grade:");
  7.   scanf("%f",&x);
  8.   if (x<=100 && x>=90)
  9.   {
  10.       printf("\nYou got A");
  11.   }
  12.  
  13.   else if (x<=89.9 && x>=80)
  14.   {
  15.       printf("\nYou got B");
  16.   }                                                                    
  17.   else if (x<=79.9 && x>=70)
  18.   {
  19.       printf("\nYou got C");
  20.   }
  21.   else if (x<=69.9 && x>=65)
  22.   {
  23.       printf("\nYou got D");
  24.   }
  25.   else
  26.   {
  27.       printf("\nYou got  F");
  28.   }
  29.  
  30.  
  31.    return 0;
  32. }
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement