Question: c++ program A Magic Square is a 2 dimension array that has the same number of rows and columns; where all rows, all columns, and
c++ program

A Magic Square is a 2 dimension array that has the same number of rows and columns; where all rows, all columns, and the two diagonals sum up to the same number called the Magic Number Example of 3-by-3 Magic Square: 6 7 215 1 59 5 8 3 45 5 15 15 15 15 Write a C++ program that fills a 3 by 3 square matrix with unique random numbers from 1 to 9, and tests if the randomly generated array forms a Magic Square Your program should loop until a masic square is found, and then you should print it on the screen. Finally before exiting, your program should print the number of tries it took to find this magic square. The Hagio Equare Fer3 by 3 is: The nunber of trial it te.k to find this masie Square 246?? Note: . Modular programming technique should be used. Thus your program should be divided into 3, 4 or more functions Only array's dimensions should be used as global variables. Communication between the called function and the caller function sbould be done through parameters passing
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
