Advertisement
Sierra_ONE

Arithmetic Operations

Sep 17th, 2023 (edited)
17
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.69 KB | Source Code | 0 0
  1. #include <stdio.h>
  2.  
  3. int main (void){
  4.     int myNum1, myNum2, myNum3;
  5.    
  6.     printf("Enter the first number: ");
  7.     scanf("%d", &myNum1);
  8.     printf("\nEnter the second number: ");
  9.     scanf("%d", &myNum2);
  10.     printf("\nEnter the third number: ");
  11.     scanf("%d", &myNum3);
  12.    
  13.     int sum = myNum1 + myNum2 + myNum3;
  14.     int difference = myNum1 - myNum2 - myNum3;
  15.     int product = myNum1 * myNum2 * myNum3;
  16.     int division = myNum1 / myNum2;
  17.     int quotient = myNum1 % myNum2 % myNum3;
  18.    
  19.     printf("The sum is: %d\n", sum);
  20.     printf("The difference is: %d\n", difference);
  21.     printf("The product is: %d\n", product);
  22.     printf("The division is: %d\n", division);
  23.     printf("The quotient is: %d", quotient);
  24.  
  25.  
  26.  
  27.     return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement