hello,
i have this assignment but i got stuck on number 3.
Question 1: Create a 3x3 array, each filled with a digit 1-9 so that the array resembles a num pad. Use for loops and construct 3 different, correct ways to print the elements of this array.
Question 2: Calculate and then print the product of the elements of the first 2 rows of this array.
**Question 3**: Have the user fill a 3x3 table, then print it. Determine if the table is “MAGIC”. Print the word “MAGIC” if it is.
It has 3 more parts and I know how to do others but don't know how to determine and print the word magic
thank you
Note: A Magic array is an n x n array where each element is a unique positive integer from 1 to n squared. These numbers are arranged so that the sum of the numbers in any horizontal, vertical, or main diagonal is always the same number.
where each element is a unique positive integer from 1 to n squared.
For each element e in the array, 1 <= e <= 9
you need to loop through the elements and make sure all values are in the correct range
For all unique elements e and f in the array, e != f
You need to loop through the elements, and for each each element, loop through the other elements to see if there are any duplicates.
These numbers are arranged so that the sum of the numbers in any horizontal, vertical, or main diagonal is always the same number.
Add up each of the rows, each of the columns and both of the diagonals. If they are all the same, the array is magic.