Advertisement
yoyo106

GPA Calculator Codeblocks

Feb 25th, 2018
99
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.     int a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p;
  8.     printf("Physics\n");
  9.     scanf("%d",&a);
  10.     printf("Chemistry\n");
  11.     scanf("%d",&b);
  12.     printf("Mechanics\n");
  13.     scanf("%d",&c);
  14.     printf("Mathematics\n");
  15.     scanf("%d",&d);
  16.     printf("Graph\n");
  17.     scanf("%d",&e);
  18.     printf("English\n");
  19.     scanf("%d",&f);
  20.     printf("Human Rights\n");
  21.     scanf("%d",&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/180;
  31.     printf("Your GPA=%d\n",p);
  32.     return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement