A
A
antonio02262017-12-05 20:08:35
Visual Basic
antonio0226, 2017-12-05 20:08:35

How to multiply odd array row (first) by third?

Hi all.
I have an array of 3 columns 4 rows.
How to multiply the 1st row by the 3rd?

Private Sub CommandButton1_Click()
Dim A() As Single
Dim n As Single
Dim m As Single
Dim i As Single
Dim j As Single

n = InputBox("×èñëî ñòðîê")
m = InputBox("×èñëî ñòîëáöîâ")

ReDim A(n, m)
For i = 1 To n
For j = 1 To m
    A(i, j) = InputBox("Ââåäèòå ýëåìåíò ìàòðèöû")
    Label1.Caption = Label1.Caption & A(i, j) & vbTab
Next j
    Label1.Caption = Label1.Caption & vbNewLine
Next i
For i = 1 To n Step 2
For j = 1 To m
    A(i, j) = A(i, j) * A(i, j)
    Label1.Caption = Label1.Caption & A(1, i) & vbTab
Next j
Next i
End Sub

There is such a script. I don't understand how to select the first row and multiply by the odd third. I understand that I need to take an odd step. I'm right?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question