Advertisement
Kawsar_Hossain

problem_5

May 25th, 2019
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.71 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     float phy,chem,bio,math,com,per;
  5.     printf("Physics=");
  6.     scanf("%f", &phy);
  7.     printf("Chemistry=");
  8.     scanf("%f", &chem);
  9.     printf("Biology=");
  10.     scanf("%f", &bio);
  11.     printf("Mathematics=");
  12.     scanf("%f", &math);
  13.     printf("Computer=");
  14.     scanf("%f", &com);
  15.     per=(phy+chem+bio+math+com)/5;
  16.     printf("percentage=%f\n", per);
  17.     if(per>=90)
  18.         printf("Grade A\n");
  19.     else if(per>=80)
  20.         printf("Grade B\n");
  21.     else if(per>=70)
  22.         printf("Grade C\n");
  23.     else if(per>=60)
  24.         printf("Grade D\n");
  25.     else if(per>=40)
  26.         printf("Grade E\n");
  27.     else if(per<40)
  28.         printf("Grade F\n");
  29.     return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement