how are you doing ?
plz i need help in making a project using vb6 that adds two (2,2) matrices ,
so here's what i've done
Dim h(2, 2), r(2, 2), d(2, 2) As Integer
For i = 1 To 2
For j = 1 To 2
t$ = "a(" + Str$(i) + "," + Str$(j) + ")="
x$ = InputBox$(t$)
h(i, j) = Val(t$)
Next
Next
For i = 1 To 2
For j = 1 To 2
s$ = "b(" + Str$(i) + "," + Str$(j) + ")="
g$ = InputBox$(s$)
r(i, j) = Val(s$)
Next
Next
For i = 1 To 2
For j = 1 To 2
d(i, j) = h(i, j) + r(i, j)
Next
Next
For i = 1 To 2
For j = 1 To 2
Print d(i, j); " ";
Next
Print
Next
the prb is that when i input my matrix numbers the summition is always printed as 0plz help
thx all


Sign In
Create Account


Back to top









