In recreational mathematics, a magic square is an arrangement of distinct numbers (i.e. each number is used once usually integers, in a square grid, where the numbers in each row and in each column, and the numbers in the main and secondary diagonals, all add up to the same number Write a function called isMagic that takes a 2D array and returns true if the 2D array is a magic square and false otherwise.
Do not use other libraries.
Please answer with C++ and comment the code.
Only use
#include
using namespace std;