Link to home
Start Free TrialLog in
Avatar of tester090797
tester090797

asked on

WRITE A PROGRAM FOR MAGIC SQUARES

WRITE A PROGRAM THAT GENERATES A MAGIC SQUARE BY THE FOLLOWING METHOD.  AN 5X5, AN 7X7, AND A 3X3 SQUARE.  THE SUM OF EVERY ROW, THE SUM OF EVERY COLUMN AND THE SUM OF THE TWO DIAGONALS MUST BE EQUAL FOR A SQUARE TO BE MAGIC.

Avatar of ozo
ozo
Flag of United States of America image

ASKER CERTIFIED SOLUTION
Avatar of Slarti
Slarti

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Slarti
Slarti

Sorry, my mistake. The complexity is proportional to n squared. But I still think you won't be able to make it any faster.
Avatar of tester090797

ASKER

THANK YOU!  I BEING A WEEKEND WARRIOR ON LEARNING HOW TO PROGRAMM IN 'C' FOUND THE SOLUTION TO BE VERY USEFUL.  SOME BOOKS I'VE PURCHASED IS ARE EITHER USEFUL OR TOO "TECH."  I'M USING MICROSOFT VISUAL C/C++ 5.0, THE ONLY THING I HAD TO DO TO GET RID OF AN COMPILE ERROR WAS TO REMOVE #INCLUDE <MEM.H> AND IT DID ITS THING.