Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- var impreso0=0;
- var impreso1=1;
- var impreso2;
- var i;
- a = prompt("Cuantos dígitos quieres del fibonacci?");
- document.write(impreso0+"<br />");
- document.write(impreso1+"<br />");
- for(i=3;i<=a;i++){
- impreso2=impreso0+impreso1;
- impreso0=impreso1;
- impreso1=impreso2;
- document.write(impreso2+"<br />");
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement