Go Array Add Two Matrix via Multi-dimensional array
package main//from w w w .j a v a 2 s. com import "fmt" func main(){ var matrix1[100][100] int var matrix2[100][100] int var sum[100][100] int var row,col int row = 3 col = 3 for i := 0; i < row; i++ { for j := 0; j < col; j++ { matrix1[i][j] = i + j } } for i := 0; i < row; i++ { for j := 0; j < col; j++ { matrix2[i][j] = i * j } } for i := 0; i < row; i++ { for j := 0; j < col; j++ { sum[i][j] = matrix1[i][j]+matrix2[i][j] } } for i := 0; i < row; i++ { for j := 0; j < col; j++ { fmt.Printf(" %d ",sum[i][j]) if(j==col-1){ fmt.Println("") } } } }