Answered step by step
Verified Expert Solution
Question
1 Approved Answer
c programming urgent pls ans AutoSave Ce Programming Assignment 6 lai Roshan File Home Insert Design Layout References Mailings Review View Help Search Share Comments
c programming urgent pls ans
AutoSave Ce Programming Assignment 6 lai Roshan File Home Insert Design Layout References Mailings Review View Help Search Share Comments A 2-dimensional array is called a magic square if the sum of the numbers along any row, column or 2a diagonal is the same. For example, the following is a magic square because the numbers along any of the 4 rows, 4 columns or 2 diagonals is 34 (i.e. (1+2+3+4+5+6+7+8+9+10+11+12+13+14+15+16)/4 - 34). 16 2 3 13 5 11 10 8 4 14 15 1 You are to write a program that have the following specifications: The user has a choice to input his/her own numbers into a 4x4 matrix or to request the program randornly generate a 4 X 4 matrix. Make sure that the randomly generated matrix contains the numbers 1 to 16 and each element is different from other numbers. The program must have the function int is Magic int array(4)[4]) which takes as paremeter a 4x4 array of integers and returns 1 if the numbers in the array form a macic square, O otherwise. Make sure that you test your program over 2 scenarios: The user keying the matrix shown in the question above 0 The program can generate a unique 4 X 4 matrix Page 1 of 2 495 words English (United States Focus FE 1001 Type here to search W ACOM 40 ENG 5:24 PM 12/27/2020Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started