Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- unsigned long int fib(int x)
- {
- if ( x < 2 )
- {
- return x;
- }
- else
- return fib(x-1)+fib(x-2);
- }
- int main()
- {
- unsigned long int a = 0;
- printf("Podaj liczbe :\n");
- scanf("%ld", &a);
- printf("%ld", fib(a));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment