Tuesday, February 3, 2015

Fibonacci Series JavaScript Program (for beginners)

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

No comments:

Post a Comment