0

```
int game()
{
int n;
cout << "enter an odd number: ";
cin >> n;
int MagicSquare[n][n]; // It says that the expression must have a constant type?
int newRow,newCol;
int i = 0;
int j = n / 2;
for (int i = 0; i < n; i++)
{
for (int j = 0; j < n; j++)
{
MagicSquare[i][j] = 0;
}
}
for (int value = 1; value <= n*n; value++)
{
MagicSquare[i][j] = value;
newRow = (i + 1) % n;
newCol = (j + 1) % n;
if (MagicSquare[newRow][newCol] == 0)
{
i = newRow;
j = newCol;
}
else
{
i = (i - 1 + n) % n;
}
}
for (int x = 0; x<n; x++)
{
for (int y = 0; y<n; y++)
cout << MagicSquare[x][y] << " "<<endl;
}
}
```