Last active
November 11, 2018 21:31
-
-
Save canokay/4bed56dfbf29228292d8f65825483ab6 to your computer and use it in GitHub Desktop.
Visual Basic Loop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public Class Form1 | |
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click | |
ListBox1.Items.Clear() | |
Dim i As Integer | |
For i = 1 To 10 | |
ListBox1.Items.Add(i) | |
Next | |
End Sub | |
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click | |
ListBox1.Items.Clear() | |
Dim i As Integer | |
For i = 1 To 10 Step 2 | |
ListBox1.Items.Add(i) | |
Next | |
End Sub | |
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click | |
ListBox1.Items.Clear() | |
Dim i As Integer | |
For i = 0 To 10 Step 2 | |
ListBox1.Items.Add(i) | |
Next | |
End Sub | |
End Class |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public Class Form1 | |
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click | |
Dim ad As String | |
Dim a As Integer | |
ad = InputBox("Kelimeyi Giriniz: ") | |
Dim sayac As Integer | |
sayac = 1 | |
For a = 0 To ad.Length - 1 | |
If ad.Chars(a) = " " Then | |
sayac = sayac + 1 | |
ElseIf ad.Length = sayac = 2 Then | |
ad = ad.ToUpper | |
End If | |
Next | |
MsgBox("Cümleniz " & " " & sayac & " " & "kelimeden oluşuyor.") | |
MsgBox("Cümleniz= " & " " & ad) | |
End Sub | |
End Class |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public Class Form1 | |
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click | |
Dim a, b As Integer | |
For a = 1 To 10 | |
For b = 1 To 10 | |
ListBox1.Items.Add(a & "*" & b & "= " & a * b) | |
Next | |
Next | |
End Sub | |
End Class |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public Class Form1 | |
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click | |
ListBox1.Items.Clear() | |
Dim ad As String | |
Dim a, b As Integer | |
ad = "ismail" | |
Dim dizi(ad.Length) As String | |
For a = 0 To ad.Length - 1 | |
For b = 0 To a | |
dizi(a) = dizi(a) + ad.Chars(b) | |
Next | |
Next | |
For a = 0 To ad.Length - 1 | |
ListBox1.Items.Add(dizi(a)) | |
Next | |
End Sub | |
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click | |
ListBox1.Items.Clear() | |
Dim ad As String | |
Dim a, b As Integer | |
ad = "ismail" | |
Dim dizi(ad.Length) As String | |
For a = 0 To ad.Length - 1 | |
For b = 0 To a | |
dizi(a) = dizi(a) + ad.Chars(b) | |
Next | |
Next | |
For a = 0 To ad.Length - 1 | |
ListBox1.Items.Add(dizi(a)) | |
Next | |
For a = ad.Length - 1 To 0 Step -1 | |
ListBox1.Items.Add(dizi(a)) | |
Next | |
End Sub | |
End Class |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment