Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>//preprocessor directive
- int main()
- {
- //Local Declarations
- int i;
- float grade,unit,prod,prodt=0,unitt=0,GPA=0;
- printf("grade\tunit\n");
- for(i=1;i<=7;i++)
- {
- scanf("%f %f",&grade,&unit);
- prod=grade*unit;
- prodt+=prod;
- unitt+=unit;
- }
- GPA=prodt/unitt;
- printf("Your GPA is%.2f\n",GPA);
- if (GPA>=3.0)
- printf("You Passed\n");
- else
- printf("You Failed\n");
- getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement