How do you compute the nth Fibonacci number using VBScript?

1 answer

Answer

1148299

2026-04-16 02:10

+ Follow

<html>

<body>

<script type="text/vbscript">

Dim a, b, c, n, nth

a = 0

b = 1

n = Cint(InputBox("Enter the value of ""n"""))

For nth = 1 to n Step 1

Document.Write(b&"<br/>")

c = a + b

a = b

b = c

Next

</script>

</body>

</html>

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.