-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
69 lines (69 loc) · 2.03 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Simulator</title>
<link rel="stylesheet" type="text/css" href="style.css">
<script type="text/javascript" src="script.js"></script>
</head>
<body>
<div class="head">Recursion (Fibonacci Series)</div>
<div class="formula"><span class="for-cont" onclick="formula()">Formula</span> <span id="form" class="form">fib(n) = fib(n-1)+fib(n-2)</span></div>
<div class="container">
<div class="division div1">
<div class="heading">Initialize</div>
<h4>Enter any number</h4>
<input id="number" type="number" required name="num" placeholder="Range 1-20"/><br>
<button type="button" id="start" onclick="startCode()">Start</button>
<br>
<button type="button" id="next" onclick="hightlight()" disabled>Next</button>
<br>
<button type="button" id="reset" onclick="location.reload()">Reset</button>
</div>
<div class="nab">
<h2>N = <span id="shw-n"></span></h2>
<h2>a = <span id="shw-a"></span></h2>
<h2>b = <span id="shw-b"></span></h2>
</div>
<div class="division div2">
<div class="heading">Step Execution</div>
<div id="code">
<div id="one">int fib(n) {</div>
<div id="two">if (n <= 1)
<br>
<span class="else">return n;</span>
</div>
<div id="three">
else if (n == 2)
<br>
<span class="else">return 1;</span>
</div>
<div id="four">
else
<br>
<span class="else">return fib(n-2) + fib(n-1);</span>
</div>
}
<div id="five">void main() {</div>
<div id="six">int num;
<br>
scanf("%d",&num);
<br>
int array[num], ele;</div>
<div id="seven">for( int i=1 ; i <= num ; i++ ) {</div>
<div id="eight">ele = fib(i);</div>
<div id="nine">array[i-1]=ele;</div>
<div id="ten">}</div>
<br>
<div id="eleven">}</div>
</div>
</div>
</div>
<div class="ot">
<div class="heading">Code Output</div>
<div class="cont">
</div>
<div id="res"></div>
</div>
</body>
</html>