RSS

Visual Basic Latihan2 – Perulangan

09 Feb

Private Sub CmdFor_Click()

Dim a As Integer

Me.Cls

Print “Perulangan For To Next”

For a = 1 To 10

Print a

Next

End Sub

Private Sub CmdDo_Click()

Dim b As Integer

Me.Cls

Print “Perulangan Do While Loop”

b = 1

Do While b <= 10

Print b

b = b + 1

Loop

End Sub

Private Sub CmdWW_Click()

Dim a As Integer

Me.Cls

Print “Perulangan While Wend”

a = 1

While a <= 10

Print a

a = a + 1

Wend

End Sub

Private Sub Cmdfor_m_Click()

Dim a As Integer

Me.Cls

Print “Perulangan For To Next Menurun”

For a = 10 To 1 Step -1

Print a

Next a

End Sub

Private Sub Cmdww_m_Click()

Dim a As Integer

Me.Cls

Print “Perulangan While Wend Menurun”

a = 10

While a >= 1

Print a

a = a – 1

Wend

End Sub

Private Sub Cmddo_m_Click()

Dim b As Integer

Me.Cls

Print “Perulangan Do While Loop Menurun”

b = 10

Do While b >= 1

Print b

b = b – 1

Loop

End Sub

Private Sub Command3_Click()

Dim a As Integer

Dim b As Integer

For a = 1 To 5

b = a * 2

Print b;

Next

End Sub

 
Tinggalkan komentar

Ditulis oleh pada Februari 9, 2011 in Yuli Bicara Tentang Teknologi

 

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

 
%d blogger menyukai ini: