TEAM CODING-BCA

VB program for Transpose of a MATRIX.

VB PROGRAM FOR TRANSPOSE OF MATRIX:

Dim a(), trans(), i, j, r, c As Integer

Private Sub Command1_Click()
r = InputBox("enter row")
c = InputBox("enter coloumns")
ReDim a(r, c)
ReDim trans(r, c)
Print "mat is"
For i = 1 To r
For j = 1 To c
a(i, j) = InputBox("enter")
Print a(i, j); "      ";
Next
Print "         "
Next
Print "transpose is"
For i = 1 To r
For j = 1 To c
trans(i, j) = a(j, i)
Print trans(i, j); "     ";
Next
Print "         "
Next
End Sub
Output

2 comments: