Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int f(int x)
- {
- if(x>0)
- return x*x-7*x+4;
- else return x*x-x+9;
- }
- int g(int x,int y)
- {
- if(x>0 && y<0)
- return 2*x-5*y+1;
- else return x+9*y+1;
- }
- int h(int x)
- {
- if(x==0)
- return 0;
- else return x+7*h(x-1)+4;
- }
- int m(int x)
- {
- if(x==0)
- return 1;
- else return 2*m(x-1);
- }
- int main()
- { int a,b,c,d;
- a=f(5);
- b=g(2,3);
- c=h(1);
- d=m(2);
- printf("functia f este:%d\n",a);
- printf("functia g este:%d\n",b);
- printf("functia h este:%d\n",c);
- printf("functia m este:%d",d);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement