Write a program to show Fibonacci Series

HTML CodeTry it

<!-- Write a program to show Fibonacci Series between 0 to 74. -->

<body>
   <div class="body">
      <div><input type="number" id="num1" placeholder="Enter a number...." /></div>
      <div><input type="button" onclick="result()" value="Submit" /></div>
   </div>
   <p id="result"></p>
</body>

CSS CodeTry it

.body{
   padding: 15px;
}
input, select{
   padding: 10px;
   margin: 5px;
   width: 300px;
}
p{
   text-align: center;
   font-size: 30px;
   color: blue;
}

JavaScript CodeTry it

function result(){
   var n = Number(document.getElementById("num1").value);
   var a = 0;
   var b = 1;
   var text = [0,1]
   document.getElementById("result").innerHTML = a;
   document.getElementById("result").innerHTML = b;
   for (i = 2;i

OutputTry it

Comments

Popular posts from this blog

PHP Code to print first 10 Fibonacci Numbers

Create a simple HTML page to demonstrate the use of different tags

Use Tables to provide layout to your web page.