Abdullah_A_lAsif_001

Grade point2

May 25th, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.87 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     int phy,che,bio,mat,com;
  5.     double total;
  6.     printf("Enter your physics number:");
  7.     scanf("%d",&phy);
  8.     printf("Enter your chemistry number:");
  9.     scanf("%d",&che);
  10.     printf("Enter your biology number:");
  11.     scanf("%d",&bio);
  12.     printf("Enter your math number:");
  13.     scanf("%d",&mat);
  14.     printf("Enter your computer number:");
  15.     scanf("%d",&com);
  16.     total=(phy+che+bio+mat+com)/5;
  17.     if(total>=90)
  18.     {
  19.         printf("Grade 'A+'\n");
  20.     }
  21.     else if(total>=80)
  22.     {
  23.         printf("Grade 'B'\n");
  24.     }
  25.     else if(total>=70)
  26.     {
  27.         printf("Grade 'C'\n");
  28.     }
  29.     else if(total>=60)
  30.     {
  31.         printf("Grade 'D'\n");
  32.     }
  33.     else if(total>=40)
  34.     {
  35.         printf("Grade 'E'\n");
  36.     }
  37.     else if(total<40)
  38.     {
  39.         printf("Grade 'F'\n");
  40.     }
  41.     return 0;
  42.  
  43.  
  44. }
Add Comment
Please, Sign In to add comment