Home Top Ad

Responsive Ads Here

Wite a program to Fiboncy Number Using Javascript

Share:

 <!DOCTYPE html>

<html>

<head>

<title>fiboncci</title>

</head>

<body>

<script type="text/javascript">

var a=0,b=1,c,count;

n=window.prompt("Enter the value generate fibonci");

var num=parseInt(n);

document.writeln("<h1>Fiboncci sries for"+num+"terms</h1>");

count=1;

document.writeln(+a+"<br>"+b);

while(count<=num-2)

{

c=a+b;

document.write("<br>"+c+"<br>");

a=b;

b=c;

     ++count;

}

</script>

</body>

</html>

************************************Output************************************

Fiboncci sries for5terms

0
1
1

2

3

Post a Comment

No comments

Welcome to saveracom.blogspot.com

Data Science using Spreadsheet Software Assignment 3

Printing Workbooks select the cells you want to print and then set that area as the print area   Steps to set a print area: Select the cells...