Name: Anonymous 2011-03-09 0:46
Im using visual c++ 2008 express edition from microsoft
Write a program that reads in 16 values from the keyboard and tests whether they form a magic square when put into a 4x4 array. You need to rest two features :
-does each of the numbers 1,2,...,16 occur in the user input
-When the numbers are put into a square, are the sums of the rows, columns, and diagonals equal to eachother?
a magic square is when the sum of the elements in each row, column and in the two diagonals have the same value.
Write a program that reads in 16 values from the keyboard and tests whether they form a magic square when put into a 4x4 array. You need to rest two features :
-does each of the numbers 1,2,...,16 occur in the user input
-When the numbers are put into a square, are the sums of the rows, columns, and diagonals equal to eachother?
a magic square is when the sum of the elements in each row, column and in the two diagonals have the same value.