Question: 2 Four in a Diagonal Line You are given a two-dimensional array of size 6x7 that contains I's, 2's, and 3's. Write a function that

 2 Four in a Diagonal Line You are given a two-dimensionalarray of size 6x7 that contains I's, 2's, and 3's. Write a

2 Four in a Diagonal Line You are given a two-dimensional array of size 6x7 that contains I's, 2's, and 3's. Write a function that determines if there are four I's or 2's in a diagonal line. Your function should ignore S's. Also, do not check the reverse-diagonals. Develop a program that . Reads a 6x7 two-dimensional array from file test diagonals.trt (create that fil. Modify the function read ar from problem 1 to create void read mat (FILE in, int x[ 17]); . Checks if there is a diagonal line of four 1's, or four 2's. Pass back true ) if a diagonal is found, false (0) otherwise. Use the function prototype int CheckDiagonals(int x[][7], int TestInt); TestInt is either 1 or 2 since the function is to decide whether a diagonal of four 1's or 2's exists Prints the result to the screen Example 1 3 3 3 3 3 3 1 3 3 3 2 3 3 3 3 1 2 3 3 3 3 3 2 1 3 3 3 3 2 3 3 32 3 No diagonals found in the matrix Example2 1 3 3 3 3 3 3 1 1 3 3 2 3 3 3 3 2133 3 3 2 3 3 32 3 At least one diagonal of four 1's exists in the matrix Example 3: Page 2 1 2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!