Question: Write C program that asks the user to enter the numbers from 1 to 16 (in any order) and then displays the numbers in a
Write C program that asks the user to enter the numbers from 1 to 16 (in any order) and then displays the numbers in a 4 by 4 arrangement, followed by the sums of the rows, columns, and diagonals: Enter the numbers from 1 to 16 in any order: 16 3 2 13 5 10 11 8 9 6 7 12 4 15 14 1
16 3 2 13 5 10 11 8 9 6 7 12 4 15 14 1
Row sums: 34 34 34 34 Column sums: 34 34 34 34 Diagonal sums: 34 34
If the row, column, and diagonal sums are all the same (as they are in this example), the numbers are said to form a magic square. The magic square shown here appears in a 1514 engraving by artist and mathematician Albrecht Durer. (Note that the middle numbers in the last row give the date of the engraving.)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
