Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main(void)
- {
- int x,y;
- int add();
- int minus();
- int multiplication();
- int division();
- x=6;
- y=3;
- printf("(x+y)(x-y)=%d\n",add(x,y));
- printf("a*a+a*b*3+b*b=%d\n",formula(x,y));
- printf("============================\n");
- system("pause");
- return 0;
- }
- int add(int a,int b)
- {
- return((a+b)*(a-b));
- }
- int formula(int a,int b)
- {
- int result;
- result=pow(a,2)+3*a*b+pow(b,2); //pow 指數 pow(a,2) a的2次方
- return(result);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement