Question: In c++ progamming , complete the following problem in the picture. All the instructions are in the picture , please read them all. Thank You!
In c++ progamming , complete the following problem in the picture. All the instructions are in the picture , please read them all. Thank You!

Problem: A Magic Square of order N consists of N squares, each of which contains a number from 1 through N2 such that the rows, columns, and diagonals sum to the same thing (called the magic sum). For example, the following is a magic square of order 3 with a magic sum of 15: 6 7 5 eg 4 Input: Your program should ask the user to enter an odd integer. For the purposes of this program, treat the input as an unsigned short. Every odd number up to 999 is valid for this program. The program should continue prompting for numbers and printing magic squares until the user enters a zero. If an even number is entered, print an appropriate error message and prompt the user to enter another number. Output: The program should output the magic squares to a text file. You don't need to print the boxes around the numbers, but arrange the numbers in columns and rows so the square is readable using print formatting. In addition to the magic square, also print out the magic sum. Miscellaneous: This program must use functions and arrays. It is your decision how many functions are used and how they are defined. There is an algorithm for creating magic squares; make sure you do your research before tackling this program
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
