. If that is meant to perform a matrix multiplication, then: 1. it would require 3 nested loops, not 2, as each element (that is 2 loops) of the result matrix is to equal the inner product of one row and one column (that is the third loop, dealing with both the row of a and the column of b) 2. I would not waste time on doing a specific case; instead use variable dimensions to make it general-purpose. 3. And unless you want this as an exercise, there is a Matrix class that does it all for you, no hassle. See e.g. here[^] :)
Luc Pattyn [My Articles] Nil Volentibus Arduum