Advertisement
yoyo106

GPA CALC V.2

Feb 26th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.64 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6.     printf("Welcome to the GPA calculator!\n");
  7.     float a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p;
  8.     printf("Physics\n");
  9.     scanf("%f",&a);
  10.     printf("Chemistry\n");
  11.     scanf("%f",&b);
  12.     printf("Mechanics\n");
  13.     scanf("%f",&c);
  14.     printf("Mathematics\n");
  15.     scanf("%f",&d);
  16.     printf("Graph\n");
  17.     scanf("%f",&e);
  18.     printf("English\n");
  19.     scanf("%f",&f);
  20.     printf("Human Rights\n");
  21.     scanf("%f",&g);
  22.     h=3*a;
  23.     i=3*b;
  24.     j=3*c;
  25.     k=3*d;
  26.     l=3*e;
  27.     m=2*f;
  28.     n=1*g;
  29.     o=h+i+j+k+l+m+n;
  30.     p=o/18;
  31.     printf("Your GPA=%f\n",p);
  32.     return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement