CODE FOR FIBONACCI SERIES USING JAVASCRIPT
Fibonacci Series = 0 1 1 2 3 5 8 13 21 34 55
<head>
<script>
let a,b=1,c,d=0,e;
e=prompt("enter number of terms","");
document.write("Fibonacci Series = ");
for(a=0;a<e;a++)
{
document.write(d);
c=d+b;
d=b;
b=c;
document.write( " ");
}
</script>
</head>
</html>
Comments
Post a Comment