Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- int max, a=1, b=1, fib;
- printf("Wprodzadz maksymalna liczbe ciagu fibonacciego\n");
- scanf("%d",&max);
- printf("liczby ciagu fibbonacciego mniejsze od %d to \n",max);
- printf("1 \n1\n");
- while(fib<=max){
- fib=a+b;
- a=b;
- b=fib;
- if(fib<=max)printf("%d \n",fib);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement