Westonci.ca is the ultimate Q&A platform, offering detailed and reliable answers from a knowledgeable community. Our platform provides a seamless experience for finding reliable answers from a knowledgeable network of professionals. Discover in-depth answers to your questions from a wide network of professionals on our user-friendly Q&A platform.

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