Originally Posted by
Bokarinho
Well there problem has a name and it is called magic squares. You are asked to write a program that will produce a magic square array of 4. A magic square of n has in each row - col - diag sum(n) = (n^3 + n) / 2 , in our case n = 4 which means sum(4) = 34.
The answer after a quick search is that for numbers like 4, 6, 8 e.g, for even numbers there is no specific algorithm that produces a magic square. There is a simple technique though that can solve your problem. Just start diging somewhere and you will find it, give us a try of your code and we will help you.