Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<stdlib.h>
- int nr;
- int F(int n) {
- nr++;
- if (n > 2)
- return F(n - 1) + F(n - 2);
- return n;
- }
- int main()
- {
- F(7);
- printf("functia este apelata de %d ori\n", nr);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment