VB.Net program to return an array of integers from a user-defined function

Hello, friend VB.Net program to return an array of integers from a user-defined function article We are going to know the topic clearly. The reason for that is that our friends have a lot of doubts. We hope the doubts will be resolved through this article. Let’s go inside this article.

VB.Net program to return an array of integers from a user-defined function

VB.Net program to return an array of integers from a user-defined function

'VB.Net program to return an array of integers 
'from a user-defined function.

Module Module1
    Function GetArray() As Integer()
        Dim arr() As Integer = New Integer(3) {1, 2, 3, 4}
        Return arr
    End Function

    Sub Main()
        Dim RetArr() As Integer

        RetArr = GetArray()

        Console.WriteLine("Elements of array:")
        For i = 0 To RetArr.Length - 1 Step 1
            Console.Write("{0} ", RetArr(i))
        Next
        Console.WriteLine()
    End Sub
End Module
Elements of array:
1 2 3 4
Press any key to continue . . .

Final Words

VB.Net program to return an array of integers from a user-defined function We hope the article has resolved your doubts. Also, let us know if you have any doubts and we will resolve your doubts.

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