' Visual Basic 2008 9.0 .NET Examples - Introduction to Arrays - Arrays : Module Exercise7Solution Sub Main() Console.Write("Count : ") Dim count As Integer = Console.ReadLine() ' If count <= 0 Then Console.WriteLine("Error : Minimum count 1.") Else Dim upperbound As Integer = count - 1 Dim fibonacci(upperbound) As Integer Dim index As Integer ' fibonacci(0) = 1 If count > 1 Then fibonacci(1) = 1 For index = 2 To upperbound fibonacci(index) = fibonacci(index - 1) + fibonacci(index - 2) Next End If ' For index = 0 To upperbound Console.Write(fibonacci(index) & " ") Next End If ' Console.ReadLine() End Sub End Module ' Visit www.studyvb.com for more examples. Copyright 2003-2008 De Wolf.