Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- float phy,chem,bio,math,com,per;
- printf("Physics=");
- scanf("%f", &phy);
- printf("Chemistry=");
- scanf("%f", &chem);
- printf("Biology=");
- scanf("%f", &bio);
- printf("Mathematics=");
- scanf("%f", &math);
- printf("Computer=");
- scanf("%f", &com);
- per=(phy+chem+bio+math+com)/5;
- printf("percentage=%f\n", per);
- if(per>=90)
- printf("Grade A\n");
- else if(per>=80)
- printf("Grade B\n");
- else if(per>=70)
- printf("Grade C\n");
- else if(per>=60)
- printf("Grade D\n");
- else if(per>=40)
- printf("Grade E\n");
- else if(per<40)
- printf("Grade F\n");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement