asked 43.7k views
19 votes
Write a function magicCheck that takes a one-dimensional array of size 16, a two-dimensional array of four rows and four columns, and the sizes of the arrays as parameters. By adding all the elements of the one-dimensional array and dividing by 4, this function determines the magicNumber. The function then adds each row, each column, and each diagonal of the two-dimensional array and compares each sum with the magic number. If the sum of each row, each column, and each diagonal is equal to the magicNumber, the function outputs ‘‘It is a magic square’’. Otherwise, it outputs ‘‘It is not a magic number’’. Do not print the sum of each row, each column, and the diagonals.

End

1 Answer

10 votes

Answer:

it is twon

Step-by-step explanation:

because i did it haha

answered
User Tingting
by
8.1k points
Welcome to Qamnty — a place to ask, share, and grow together. Join our community and get real answers from real people.

Categories