Hello, I'm almost finished with a homework assignment requiring me to write a program that checks to see if a user inputted square with n(order) rows and n(order) columns is a magic square. The rules for a magic square are as follows:
must have all different numbers between 1-n*n, each row's sum must equal the others, and each column's sum must equal the others.
I am having a hard time figuring out why when the program checks the sums of the rows and columns, occasionally the sums work and occasionally emit garbage. If you could take a look at my code and give me a nudge in the right direction, that would be most appreciated. Thanks!
The code that applies to the situation is the following: \