Question: Make a program in c++ that complies with the following instructions. You are very fond of riddles and in particular you are fascinated by the

Make a program in c++ that complies with the following instructions.

You are very fond of riddles and in particular you are fascinated by the topic of magic squares. A magic square is a matrix of NN numbers that has the property that the sum of the elements of each row, each column and both diagonals are worth the same. Even if building a magic square can get a bit complicated, you think you can write a program to tell you whether or not a square matrix is a magic square.

Entry: An integer N followed by NN integers y representing the elements of an array given square from top to bottom and left to right. You can assume that 1 N 100.

Exit: A 1 if the given matrix is a magic square and a 0 otherwise.

Example:

-Entry. 4 1 14 14 4 11 7 6 9 8 10 10 5 13 2 3 15 -Exit. 1

-Entry. 3 1 0 0 0 0 1 1 0 0 -Exit. 0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!