Answered step by step
Verified Expert Solution
Link Copied!

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 ansimage text in transcribed

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/2020

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DB2 11 The Ultimate Database For Cloud Analytics And Mobile

Authors: John Campbell, Chris Crone, Gareth Jones, Surekha Parekh, Jay Yothers

1st Edition

1583474013, 978-1583474013

More Books

Students also viewed these Databases questions