Monday, April 14, 2014

Windows Scripting (the normal shell) for Ex VB Programmers - Lesson 2–Solution Part 2

Fibonacci Series Solution

wscript.echo "Fibonacci Series"
x=1
y=1
wscript.echo 1
wscript.echo 1
for a=3 to 15
    z=x+y
    x=y
    y=z
    wscript.echo z
next

 

Output

C:\scripts>cscript fibo.vbs //nologo
Fibonacci Series
1
1
2
3
5
8
13
21
34
55
89
144
233
377
610

 

An interesting video on Fibonacci Series can be viewed here.

No comments: