How to Generate N * N Magic Square – JAVA (via Amila Surendra)

This Code Generates a N*N Magic square where N is odd. Here I've used Siamese method to construct Magic Squares. So this only generates a single combination of a magic square.To run the program first compile it & then run the program, passing the required N as a argument.   Eg: java MagicSquare 3 generates a 3*3 Magic Square   Here's The Code public class MagicSquare { public MagicSquare(int n) { if (n % 2 == 0) { … Read More

via Amila Surendra


About inislamicworld

i love the world of Peace
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s