Popular Posts :
Home » » Contoh Program Looping Sederhana Visual Basic

Contoh Program Looping Sederhana Visual Basic

Jumat, 25 Maret 2011 | 0 komentar

1. Looping dengan output :

















Kode pada Command Button:
Private Sub Command1_Click()
For y = 1 To Text1.Text
For x = 1 To y
Print y;
Next y
Print
Next
End Sub


2. Looping dengan output : 


















Kode pada Command Button:
Private Sub Command1_Click()
For y = 1 To Text1.Text
For x = 1 To y
Print x;
Next y
Print
Next
End Sub


3. Looping dengan Output :


















Kode pada Command Button:
Private Sub Command1_Click()
For y = Text1.Text To 1 Step -1
For x = 1 To y
Print y;
Next y
Print
Next
End Sub


4. Looping dengan Output :


















Kode pada Command Button:
Private Sub Command1_Click()
For y = Text1.Text To 1 Step -1
For y = 1 To y
Print x;
Next y
Print
Next
End Sub


5. Looping dengan Output :

Kode pada Command Button:

Private Sub Command1_Click()
For a = 1 To Val(Text1.Text) - 1
For b = 1 To a
Print b;
Next b
Print
Next
For c = Text1.Text To 1 Step -1
For d = 1 To c
Print d;
Next d
Print
Next
End Sub


6. Looping dengan Output :


Kode pada Command Button:

Private Sub Command1_Click()
For a = 1 To Val(Text1.Text) - 1
For b = 1 To a
Print a;
Next b
Print
Next
For c = Text1.Text To 1 Step -1
For d = 1 To c
Print c;
Next d
Print
Next
End Sub

Share this article :

0 komentar:

Posting Komentar

 
Support : Indonesia Blogger | Eggy Prayogia Adistira | The Prayogia
| SUHE
Copyright © 2012. Eprayogia - All Rights Reserved
Template Modify by Eprayogia
Proudly powered by Eggy Prayogia Adistira