contoh perulangan

Download contoh perulangan

If you can't read please download the document

Upload: murhady-nazaruddin

Post on 17-Jan-2016

5 views

Category:

Documents


3 download

DESCRIPTION

CP

TRANSCRIPT

Public Class Form1 Dim a As Integer Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click ListBox1.Items.Clear() For a = 1 To 100 ListBox1.Items.Add(a) Next End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click ListBox1.Items.Clear() For a = 100 To 1 Step -2 ListBox1.Items.Add(a) Next End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click ListBox1.Items.Clear() a = Asc("A") Do Until a > Asc("Z") ListBox1.Items.Add("huruf :" & Chr(a)) a = a + 1 Loop End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click ListBox1.Items.Clear() a = Asc("Z") Do While a >= Asc("A") ListBox1.Items.Add("huruf :" & Chr(a)) a = a - 1 Loop End SubEnd Class