Intel Corporation interview question

write a program that checks if a matrix is a magic square