A magic square is part of the recreational mathematics and the numbers in all rows, all colums and both diagonals sum to the same constant. Following is an example of a magic square:

2 7 6

9 5 1

4 3 8

In the above example, the sum of all the rows and all the colums is 15. The sum of both the diagonals is also 15.

2 7 6

9 5 1

4 3 8

In the above example, the sum of all the rows and all the colums is 15. The sum of both the diagonals is also 15.