Imports System
Module KthSmallestFinder
Function FindKthSmallestNumber(arr As Integer(), k As Integer) As Integer
Array.Sort(arr)
Return arr(k - 1)
End Function
Sub Main()
Dim arr As Integer() = {42, 90, 21, 30, 37, 81, 45}
Dim k As Integer = 3
Dim result As Integer = FindKthSmallestNumber(arr, k)
Console.WriteLine(result)
End Sub
End Module
' run:
'
' 37
'