Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- printf("Welcome to the GPA calculator!\n");
- float a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p;
- printf("Physics\n");
- scanf("%f",&a);
- printf("Chemistry\n");
- scanf("%f",&b);
- printf("Mechanics\n");
- scanf("%f",&c);
- printf("Mathematics\n");
- scanf("%f",&d);
- printf("Graph\n");
- scanf("%f",&e);
- printf("English\n");
- scanf("%f",&f);
- printf("Human Rights\n");
- scanf("%f",&g);
- h=3*a;
- i=3*b;
- j=3*c;
- k=3*d;
- l=3*e;
- m=2*f;
- n=1*g;
- o=h+i+j+k+l+m+n;
- p=o/18;
- printf("Your GPA=%f\n",p);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement