Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribedimage text in transcribed

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

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

Big Data And Hadoop Fundamentals Tools And Techniques For Data Driven Success

Authors: Mayank Bhushan

2nd Edition

9355516665, 978-9355516664

More Books

Students also viewed these Databases questions

Question

Determine miller indices of plane A Z a/2 X a/2 a/2 Y

Answered: 1 week ago