Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int add(int x,int y)
- {
- return x+y;
- }
- int sub(int x,int y)
- {
- return x-y;
- }
- int quotient(int x,int y)
- {
- return x/y;
- }
- int remains(int x,int y)
- {
- return x%y;
- }
- int multiply(int x, int y)
- {
- return x*y;
- }
- int power4(int x)
- {
- return x * x * x * x;
- }
- int main()
- {
- int u,x,y,z;
- printf("Input the variables for u,x,y, and z: ");
- scanf("%d%d%d%d"&u,&x,&y,&z);
- printf("The answer to %d+(%d/%d) is %d\n",x,y,z,add(x,quotient(y,z)));
- printf("The answer to (%d-%d^%d)^4/(%d-%d) is %d\n",x,y,z,x,y,quotient(power4(sub(x,multiply(y,z))),sub(x,y)));
- printf("The answer to %d-(%d-%d/%d(7-%d)) is %d\n",x,y,z,u,x,sub(x,sub(y,multiply(quotient(z,u),sub(7,x))))); //x - (y - z / u (7 - x))
- system("pause"); //MAKE SURE TO REMOVE THIS LINE WHEN HANDING IN!
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement