write a java program for,
In recreational mathematics, a magic square is an N X N square grid (where N is the number of cells on each side) filled with distinct positive integers in the range 1,2,...,n^2 such that each cell contains a different integer and the sum of the integers in each row, column and diagonal is equal.
Given a square matrix as input, determine whether it is a magic square or not. Print "ITS A MAGIC!" if the square matrix is a magic square, otherwise print "NO MAGIC".
Assumptions:
1) All the elements of the square matrix are different and in the range, 1,2,...,n^2. Hence need not be verified.
2) The row and column size are to be accepted in R and C, as integer inputs, and R & C, both are >=2, even though it is a square matrix. In any case, R is equal to C and need not be verified.
=15
2 7 6 =15
9 5 1 =15
4 3 8 =15
=15 =15 =15 =15
Answers
Answered by
0
Answer:
Geography is the study of places and the relationships between people and their environments. Geographers explore both the physical properties of Earth's surface and the human societies spread across it. ... Geography seeks to understand where things are found, why they are there, and how they develop and change over time.
Similar questions