Advertisement
Niloy007

Mehedi's problem

Jul 23rd, 2020
166
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.  
  3. int main() {
  4.     int choise, a, b, result;
  5.     printf("Enter two numbers:\n");
  6.     scanf("%d %d", &a, &b);
  7.  
  8.  
  9.     printf("1. Addition\n");
  10.     printf("2. Subtraction\n");
  11.     printf("3. Multiplication\n");
  12.     printf("4. Division\n");
  13.     printf("Enter your choise\n");
  14.     scanf("%d", &choise);
  15.  
  16.  
  17.     if(choise == 1) {
  18.         result = a + b;
  19.         printf("Addition: %d\n", result);
  20.     } else if (choise == 2) {
  21.         result = a - b;
  22.         printf("Subtraction: %d\n", result);
  23.     } else if (choise == 3) {
  24.         result = a * b;
  25.         printf("Multiplication: %d\n", result);
  26.     } else if (choise == 4) {
  27.         result = a / b;
  28.         printf("Quotient: %d\n", result);
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement