VB.Net program to demonstrate the Sort() method of Array class

Thanks for reading my article first. VB.Net program to demonstrate the Sort() method of Array class We are going to learn more about this in this article. Let’s go into the article

VB.Net program to demonstrate the Sort() method of Array class

VB.Net program to demonstrate the Sort() method of Array class

'VB.NET program to demonstrate the Sort() method 
'of Array class.

Imports System

Module Module1
    Sub Main()
        Dim arr() As Integer = {90, 20, 70, 40, 50}

        Console.WriteLine("Original Array elements: ")
        For i = 0 To arr.Length - 1 Step 1
            Console.Write(arr(i) & " ")
        Next

        Array.Sort(arr)

        Console.WriteLine(vbCrLf & "Sorted Array elements: ")
        For i = 0 To arr.Length - 1 Step 1
            Console.Write(arr(i) & " ")
        Next

        Console.WriteLine()
    End Sub
End Module
Original Array elements:
90 20 70 40 50
Sorted Array elements:
20 40 50 70 90
Press any key to continue . . .

Final Words

VB.Net program to demonstrate the Sort() method of Array class We hope this article solves all your doubts. If in doubt let me know.

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Deekshi. Here, I post about programming to help developers.

Share on:

Leave a Comment