SLIP
9_1

Option
Explicit

Option
Base 1

Private
Sub cmdMatrix_Click()

Dim
a(2, 2) As Integer

Dim
b(2, 2) As Integer

Dim
c(2, 2) As Integer

Dim
i As Integer

Dim
j As Integer

Dim
k As Integer

For
i = 1 To 2

For
j = 1 To 2

a(i,
j) = Val(InputBox("Enter Elements of A matrix"))

Next
j

Next
i

For
i = 1 To 2

For
j = 1 To 2

b(i,
j) = Val(InputBox("Enter Elements of B matrix"))

Next
j

Next
i

Print
"Matrix A is"

For
i = 1 To 2

For
j = 1 To 2

Print
a(i, j);

Next
j

Print
" "

Next
i

Print
"Matrix B is "

For
i = 1 To 2

For
j = 1 To 2

Print
b(i, j);

Next
j

Print
" "

Next
i

For
i = 1 To 2

For j = 1 To 2

c(i,
j) = 0

For k = 1 To 2

c(i,
j) = c(i, j) + a(i, k) * b(k, j)

Next k

Next j

Next
i

Print
"Multiplication Matrix is "

For
i = 1 To 2

For
j = 1 To 2

Print
c(i, j);

Next
j

Print
" "

Next
i

End
Sub

## No comments:

## Post a Comment

Note: only a member of this blog may post a comment.