How to Sort An Array In Console Application?

By Goniey N (Mr. G)

It Will Sort An Given Array In Ascending Using Console Application...

Sub Main()
Dim a(10), i, j, temp, n, p As Integer
Console.WriteLine("Enter the Number for Sorting:=>")
        n =

        For i = 0 To n
            a(i) =
Next i

        For i = 0 To n - 1
For j = i + 1 To n
If (a(i) > a(j)) Then
                    temp = a(i)
                    a(i) = a(j)
                    a(j) = temp
End If
Next j
        Next i

        For p = 0 To n
Next p
End Sub

How to Sort An Array In Console Application?  (813 Views)