Help please point out errors please. Condition: a 10x10 matrix is specified in the DataGridView. It is necessary to determine the number of lines in which the sum of the elements is less than 10. Here is the code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim i, j, s, k As Integer k = 0 For j = 0 To 9 s = 0 For i = 0 To 9 s = Val(A(0, i).Value) + Val(A(1, i).Value) + Val(A(2, i).Value) + Val(A(3, i).Value) + Val(A(4, i).Value) + Val(A(5, i).Value) + Val(A(6, i).Value) + Val(A(7, i).Value) + Val(A(8, i).Value) + Val(A(9, i).Value) If s < 10 Then k = k + 1 End If Next i Next j TextBox1.Text = k