I have to program in an Array the multiplication of the rows 0 and 1, how would i go about it?
123
456
789
You could start by asking a clear question.
3 * 456:
Get the last number from the first row, and the last number of the second row. Multiply:
int m22 = 3*6 = 18
Get the last number from the first row, and the center number of the second row * 10. Multiply:
int m21 = 3*5 * 10 = 150
Get the last number from the first row, and the first number of the second row * 100. Multiply:
int m20 = 3*4 * 100 = 1200
summ2 = m22 + m21 + m20 = 1368
20 * 456:
Get the center number from the first row * 10, and the last number of the second row. Multiply:
int m12 = 2 * 10 * 6 = 120
Etcetera
(In this example I used variables where the numbers represent the position in the array)
Last edited on