Number Programs

Fibonacci Program


<html>
<body>
<script type="text/javascript">
    var a = 0, b = 1, c = 0;
    document.write("Fibonacci Series <br/> <br>"); 

    while (b <= 50) {

      document.write(c);
      document.write("<br/>");
      c = a + b;
      a = b;
      b = c;

    }
</script>
</body>
</html>