Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int phy,che,bio,mat,com;
- double total;
- printf("Enter your physics number:");
- scanf("%d",&phy);
- printf("Enter your chemistry number:");
- scanf("%d",&che);
- printf("Enter your biology number:");
- scanf("%d",&bio);
- printf("Enter your math number:");
- scanf("%d",&mat);
- printf("Enter your computer number:");
- scanf("%d",&com);
- total=(phy+che+bio+mat+com)/5;
- if(total>=90)
- {
- printf("Grade 'A+'\n");
- }
- else if(total>=80)
- {
- printf("Grade 'B'\n");
- }
- else if(total>=70)
- {
- printf("Grade 'C'\n");
- }
- else if(total>=60)
- {
- printf("Grade 'D'\n");
- }
- else if(total>=40)
- {
- printf("Grade 'E'\n");
- }
- else if(total<40)
- {
- printf("Grade 'F'\n");
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment