Imports System
Module Program
' ------------------------------------------------------------
' ArrayToNumber
' Converts an Integer() array into a single integer by
' concatenating each element as text.
' Example: {14, 6, 9, 31, 20} → 14693120
' ------------------------------------------------------------
Function ArrayToNumber(arr As Integer()) As Integer
Dim s As String = ""
For Each num As Integer In arr
s &= num.ToString() ' concatenate as text
Next
Return Integer.Parse(s) ' convert final string to integer
End Function
Sub Main()
Dim arr As Integer() = {14, 6, 9, 31, 20}
Dim n As Integer = ArrayToNumber(arr)
Console.WriteLine("n = " & n)
End Sub
End Module
'
' run:
'
' n = 14693120
'