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/index.php)
-   Visual Programming (http://bzupages.com/forumdisplay.php?f=237)
-   -   Assignment Q1:Add two matrices of 2x3 using vb console Application (http://bzupages.com/showthread.php?t=6867)

shmsa 06-12-2009 04:45 PM

Assignment Q1:Add two matrices of 2x3 using vb console Application
 
Code:

Module additionMatrices

    Sub Main()
        Dim ar1 As Integer(,)
        ar1 = New Integer(1, 2) {}
        Dim i, j As Integer
        For i = 0 To 1
            For j = 0 To 2
                ar1(i, j) = Console.ReadLine()

            Next
        Next
        For i = 0 To 1
            For j = 0 To 2
                Console.Write(ar1(i, j) & vbTab)
            Next
            Console.Write(vbCrLf)
        Next


        Dim ar2 As Integer(,)
        ar2 = New Integer(1, 2) {}

        For i = 0 To 1
            For j = 0 To 2
                ar2(i, j) = Console.ReadLine()

            Next
        Next
        For i = 0 To 1
            For j = 0 To 2
                Console.Write(ar2(i, j) & vbTab)

            Next
            Console.Write(vbCrLf)
        Next

        For i = 0 To 1
            For j = 0 To 2
                Console.Write(ar1(i, j) + ar2(i, j) & vbTab)
            Next
            Console.Write(vbCrLf)
        Next
    End Sub

End Module


.BZU. 10-12-2009 08:01 AM

Re: Assignment Q1:Add two matrices of 2x3 using vb console Application
 
thanks for you contribution , for bzupages.. :)


All times are GMT +5. The time now is 06:09 PM.

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