Advertisement
jacknpoe

Fibonacci (english)

Jun 1st, 2016
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script type="text/javascript">
  2.  
  3. var first = 0, second = 1, temporary = 0, number_seq = 15, omit_0 = false;
  4.  
  5. if( omit_0) first = 1;
  6. if( number_seq > 0) document.write( first);
  7. if( number_seq > 1) document.write( " / " + second);
  8.  
  9. for ( var iterator = 0; iterator < number_seq - 2; iterator++) {
  10.     temporary = second;
  11.     second += first;
  12.     first = temporary;
  13.     document.write( " / " + second);
  14. }
  15.  
  16. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement