helsinki2103

PRF192 Lab03 1

May 18th, 2021
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.65 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<conio.h>
  3.  
  4. int main() {
  5.     int a, b, c, d;
  6.     a = 50; b = 24; c = 68;
  7.    
  8.     d = a * b + c / 2;
  9.     printf("The value after a*b+c/2 is: %d\n",d);
  10.    
  11.     d = a % b;
  12.     printf("The value after a mod b is: %d\n",d);
  13.    
  14.     d = a * b - c;
  15.     printf("The value after a*b-c is: %d\n",d);
  16.    
  17.     d = a / b + c;
  18.     printf("The value after a/b+c is: %d\n",d);
  19.    
  20.     d = a + b * c;
  21.     printf("The value after a+b*c is: %d\n",d);
  22.    
  23.     d = (a + b) * c;
  24.     printf("The value after (a+b)*c is: %d\n",d);
  25.    
  26.     d = a * (b + c + (a - c) * b);
  27.     printf("The value after a*(b+c+(a-c)*b) is: %d\n",d);
  28. }
  29.  
Advertisement
Add Comment
Please, Sign In to add comment