Subject: Re: 5x5 magic square
Date: Tue, 8 Jul 1997 21:27:21 -0400
From: Alexander Bogomolny
Your question is quite ambiguous. Assume I know a method for constructing a 5x5 magic square. I can do this on paper and then place a result into a C array ( or ). Is it what you want?
The second possibility is to provide an algorithm to construct a square (on paper or programmatically.) There are several algorithms known for an nxn square with n odd. But you ask only about n = 5.
Still assuming the latter, given an algorithm it may be translated into C code in a variety of ways. If you program in C you must be able to convert a Description into code. Then why do you ask about code?
Just in case, here is one solution (by Bachet's method):