BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan

BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan (http://bzupages.com/)
-   Visual Programming (http://bzupages.com/237-visual-programming/)
-   -   Taking transpose of a matrix program code: implementation of 2 dimensional arrays (http://bzupages.com/f237/taking-transpose-matrix-program-code-implementation-2-dimensional-arrays-7021/)

taha khan 10-12-2009 11:15 PM

Taking transpose of a matrix program code: implementation of 2 dimensional arrays
 

Taking Transpose of a Matrix

Code:

Module Mattranspose


    Sub Main()
        Dim i, j As Integer
        Dim Matrix1 As Integer(,) = New Integer(,) {{1, 2, 3}, {4, 5, 6}}
        For i = 0 To 1
            For j = 0 To 2

                Console.Write(Matrix1(i, j) & vbTab)
            Next
            Console.Write(vbCrLf)

        Next

        Console.Write("Transpose of the above matrix is given below:" & vbCrLf)
        For i = 0 To 2
            For j = 0 To 1
                Console.Write(Matrix1(j, i) & vbTab)
            Next
            Console.Write(vbCrLf)
        Next

    End Sub




End Module



All times are GMT +5. The time now is 04:14 AM.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.