Advertisement
Bivas_Saha

Problem 5

May 27th, 2019
133
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. int main()
  3. {
  4.     float physics,chemistry,biology,mathematics,computer,percent;
  5.     printf("Physics=");
  6.     scanf("%f", &physics);
  7.     printf("Biology=");
  8.     scanf("%f", &biology);
  9.     printf("Chemistry=");
  10.     scanf("%f", &chemistry);
  11.     printf("Mathematics=");
  12.     scanf("%f", &mathematics);
  13.     printf("Computer=");
  14.     scanf("%f", &computer);
  15.     percent=(physics+chemistry+biology+mathematics+computer)/5;
  16.     printf("percentage= %f", percent);
  17.     if(percent>=90)
  18.         printf("Grade A\n");
  19.     else if(percent>=80)
  20.         printf("Grade B\n");
  21.     else if(percent>=70)
  22.         printf("Grade C\n");
  23.     else if(percent>=60)
  24.         printf("Grade D\n");
  25.     else if(percent>=40)
  26.         printf("Grade E\n");
  27.     else if(percent<40)
  28.         printf("Grade F\n");
  29.     return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement