Tutorial Programming

Tutorial basic, Visual Studio VB.NET 2013 Pengunaan Looping


Hallo sahabat saya akan menjelaskan Pengunaan Looping pada visual studio 2013, oke langsung aja

For 


For counter=1 to 10
ListBox1.Items.Add (counter)
Next


Do


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim sum, n As Integer

ListBox1.Items.Add(“n” & vbTab & “Sum”)
ListBox1.Items.Add(“———————-”)
Do
n += 1
sum += n
ListBox1.Items.Add(n & vbTab & sum)
If n = 100 Then
Exit Do
End If
Loop

End Sub

While


Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim sum, n As Integer
ListBox1.Items.Add(“n” & vbTab & “sum”)
ListBox1.Items.Add(“———————-“)

While n <> 10

n += 1
sum += n
ListBox1.Items.Add(n & vbTab & sum)

End While

End Sub

Sekian tutorial saya sahabat semoga bermanfaat yah.

No comments:

Post a Comment

Tutorial Programming Designed by Templateism | Ary EJFA Copyright © 2015

Theme images by richcano. Powered by Blogger.