Advertisement
dzieciol

Labolatorium III zadanie 2

Nov 5th, 2015
407
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.44 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6.     int max, a=1, b=1, fib;
  7.  
  8.     printf("Wprodzadz maksymalna liczbe ciagu fibonacciego\n");
  9.  
  10.         scanf("%d",&max);
  11.          printf("liczby ciagu fibbonacciego mniejsze od %d to \n",max);
  12.          printf("1 \n1\n");
  13.         while(fib<=max){
  14.             fib=a+b;
  15.             a=b;
  16.             b=fib;
  17.  
  18.         if(fib<=max)printf("%d \n",fib);
  19.         }
  20.  
  21.  
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement