Welcome to collectivesolver - Programming & Software Q&A. A website you can trust. All programs tested and works. Contact: aviboots(AT)netvision.net.il
Liquid Web Managed Dedicated Server: RAID 1 SSD with 16GB of RAM minimum! 24/7 On-Site Heroic Support! Industry-Leading SLA!

BlueHost Web Hosting

Ecommerce Software - Best Ecommerce Platform Made for You - Free Trial

Ecommerce Software - Best Ecommerce Platform Made for You - Free Trial

getflywheel wordpress hosting


Liquid Web Cloud VPS Hosting

8,505 questions

11,788 answers

573 users

How to declare and print a 4 x 3 multidimensional array and initialize array elements in VB.NET

3 Answers

0 votes
Module Module1

    Sub Main()

        Dim matrix = New Integer(3, 2) {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}, {10, 11, 12}}

        Console.WriteLine(matrix(0, 0))
        Console.WriteLine(matrix(1, 0))
        Console.WriteLine(matrix(2, 0))
        Console.WriteLine(matrix(3, 0))

        Console.WriteLine(matrix(0, 1))
        Console.WriteLine(matrix(1, 1))
        Console.WriteLine(matrix(2, 1))
        Console.WriteLine(matrix(3, 1))

    End Sub

End Module

' run:
' 
' 1
' 4
' 7
' 10
' 2
' 5
' 8
' 11

 




answered Aug 12 by avibootz
0 votes
Module Module1

    Sub Main()

        Dim matrix = New Integer(3, 2) {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}, {10, 11, 12}}

        For i As Integer = 0 To 3
            For j As Integer = 0 To 2
                Console.Write("{0,3}", matrix(i, j))
            Next
            Console.WriteLine()
        Next
    End Sub

End Module

' run:
' 
' 1  2  3
' 4  5  6
' 7  8  9
' 10 11 12

 




answered Aug 12 by avibootz
0 votes
Module Module1

    Sub Main()

        Dim matrix = New Integer(3, 2) {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}, {10, 11, 12}}

        For i As Integer = 0 To matrix.GetLength(0) - 1
            For j As Integer = 0 To matrix.GetLength(1) - 1
                Console.Write("{0,3}", matrix(i, j))
            Next
            Console.WriteLine()
        Next
    End Sub

End Module

' run:
' 
' 1  2  3
' 4  5  6
' 7  8  9
' 10 11 12

 




answered Aug 12 by avibootz
...