Skip to content

Instantly share code, notes, and snippets.

@ecmelkytz
Last active October 6, 2015 13:58
Show Gist options
  • Save ecmelkytz/3003623 to your computer and use it in GitHub Desktop.
Save ecmelkytz/3003623 to your computer and use it in GitHub Desktop.
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim deger
Dim sayi, ara, z, y, art As Integer
For i = 1 To 10
Randomize()
deger = Int((100 * Rnd()) + 1)
ListBox1.Items.Add(deger)
Next
For s = 0 To 9
ListBox2.Items.Add(ListBox1.Items(s))
Next
For i = 0 To 8
For x = 0 To 8
z = ListBox1.Items(x)
art = x + 1
y = ListBox1.Items(art)
If z > y Then
ara = ListBox1.Items(x)
ListBox1.Items(x) = ListBox1.Items(x + 1)
ListBox1.Items(x + 1) = ara
End If
Next
Next
End Sub
End Class
@ecmelkytz
Copy link
Author

Rastgele oluşturulan sayıları bubble sort yöntemiyle küçükten büyüğe sıralar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment