You are on page 1of 2

Private Sub FOR_Click()

Dim a, b, c, series As Integer


Picture1.Cls
series = InputBox("Enter number of series")
a=1
For x = 1 To series
If x > 2 Then
c=a+b
a=b
b=c
Picture1.Print c & Space(2);
Else
Picture1.Print a & Space(2);
b=a
End If
Next x
End Sub

Private Sub DOWHILE_Click()


Dim a, b, c, series As Integer
Picture1.Cls
series = InputBox("Enter number of series")
a=1
Do While x < series
If x > 1 Then
c=a+b
a=b
b=c
Picture1.Print c & Space(2);
Else
Picture1.Print a & Space(2);
b=a
End If
x=x+1
Loop
End Sub

Private Sub DOUNTILL_Click()


Dim a, b, c, series As Integer
Picture1.Cls
series = InputBox("Enter number of series")
a=1
Do Until x > series - 1
If x > 1 Then
c=a+b
a=b
b=c
Picture1.Print c & Space(2);
Else
Picture1.Print a & Space(2);
b=a
End If
x=x+1
Loop
End Sub

You might also like