Question: please write it in C progrmaiing 2 Four in a Diagonal Line You are given a two-dimensional array of size 6x7 that contains 1's, 2's,

please write it in C progrmaiing 2 Four in a Diagonal Lineplease write it in C progrmaiingYou are given a two-dimensional array of size 6x7 that contains 1's,

2 Four in a Diagonal Line You are given a two-dimensional array of size 6x7 that contains 1's, 2's, and 3's. Write a function that determines if there are four 1's or 2's in a diagonal line. Your function should ignore 3's. Also, do not check the reverse-diagonals Develop a program that e Reads a 6x7 t sional array from file test diagonals.trt (create that file). Modify the function readar from problem 1 to create void read mat (FILE *in, int xL1 171); Checks if there is a diagonal line of four 1's, or four 2's. Pass back true (1) if a diagonal is found, false (0) otherwise. Use the function prototype int CheckDiagonals (int x[I[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 1 3 3 3 3 3 3 1 3 3 3 2 3 3 3 3 2 1 3 3 3 3 2 3 3 3 2 3 No diagonals found in the matrix Example 2 1 3 3 3 33 3 11 3 3 2 3 3 3 3 21 33 3 3 2 3 3 3 2 3 At least one diagonal of four 1's exists in the matrix Example 3 1 3 3 3 33 3 -13312333 3 3 2 1 2 3 3 3 2 3 3 3 2 3 At least one diagonal of four 1's exists in the matrix At least one diagonal of four 2's exists in the matrix

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!