please help me as early as possible to solve the problem of matrix multiplication
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
ar1txt.Text = "2"
ai1txt.Text = "3"
ar2txt.Text = "4"
ai2txt.Text = "5"
ar3txt.Text = "6"
ai3txt.Text = "7"
ar4txt.Text = "8"
ai4txt.Text = "9"
br1txt.Text = "2"
bi1txt.Text = "3"
br2txt.Text = "4"
bi2txt.Text = "5"
br3txt.Text = "6"
bi3txt.Text = "7"
br4txt.Text = "8"
bi4txt.Text = "9"
Dim A(0 To 10, 0 To 10) As Double
Dim B(0 To 10, 0 To 10) As Double
Dim Product(0 To 10, 0 To 10) As Double
Dim J As Integer
Dim K As Integer
Dim X As Integer
For J = 0 To 10
For K = 0 To 10
Product(J, K) = A(J, X) * B(X, K)
For X = 1 To 10
Product(J, K) = Product(J, K) + A(J, X) * B(X, K)
Next X
Next K
Next J
ans1txt.Text = Product(J, K)
ans2txt.Text = Product(J, K)
ans3txt.Text = Product(J, K)
ans4txt.Text = Product(J, K)
End Sub
this is my code for matrix multiplication
but getting error as "Index was outside the bounds of the array"
please tell me where its getting wrong