Advertisement
Adm1n_0v3rride

Calcuator v1.0

Sep 12th, 2017
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.91 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. int main()
  4. {
  5.     int a;
  6.     int b;
  7.     int mathmaticaloperation;
  8.    
  9.     printf("Welcome to Adm1n_0v3rride's calcuator program v1.0\n");
  10.     printf("Please type the first number: ");
  11.     scanf("%d",&a);
  12.     printf("Please type the secound number please: ");
  13.     scanf("%d",&b);
  14.    
  15.     printf("Please input the number for the mathmatical operation that you are trying to do\n1.addition\n2.subtraction\n3.multiplication\n4.division\n5.modulo: ");
  16.     scanf("%d",&mathmaticaloperation);
  17.    
  18.     if(mathmaticaloperation == 1)
  19.     {
  20.         printf("The sum is %d .\n",a + b);
  21.     }
  22.     if(mathmaticaloperation == 2)
  23.     {
  24.         printf("The answer is %d .\n",a - b);
  25.     }
  26.     if(mathmaticaloperation == 3)
  27.     {
  28.         printf("The answer is %d .\n",a * b);
  29.     }
  30.     if(mathmaticaloperation == 4)
  31.     {
  32.         printf("The answer is %d .\n",a / b);
  33.     }
  34.     if(mathmaticaloperation == 5)
  35.     {
  36.         printf("The answer is %d .\n",a % b);
  37.     }
  38.     return 0;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement