Guest User

Untitled

a guest
May 16th, 2018
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.21 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main(int argc, char *argv[])
  4. {
  5.   int f1 = 1,
  6.     f2 = 1,
  7.     f = 0;
  8.  
  9.   for (int i = 3; i < 20; i++)
  10.     {
  11.       f = f1 + f2;
  12.       f1 = f2;
  13.       f2 = f;
  14.     }
  15.  
  16.   printf("fib(19)=%d\n", f);
  17. }
Add Comment
Please, Sign In to add comment