Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- int a;
- int b;
- int mathmaticaloperation;
- printf("Welcome to Adm1n_0v3rride's calcuator program v1.0\n");
- printf("Please type the first number: ");
- scanf("%d",&a);
- printf("Please type the secound number please: ");
- scanf("%d",&b);
- 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: ");
- scanf("%d",&mathmaticaloperation);
- if(mathmaticaloperation == 1)
- {
- printf("The sum is %d .\n",a + b);
- }
- if(mathmaticaloperation == 2)
- {
- printf("The answer is %d .\n",a - b);
- }
- if(mathmaticaloperation == 3)
- {
- printf("The answer is %d .\n",a * b);
- }
- if(mathmaticaloperation == 4)
- {
- printf("The answer is %d .\n",a / b);
- }
- if(mathmaticaloperation == 5)
- {
- printf("The answer is %d .\n",a % b);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement