Question: Write a program Write a program that randomly generates a 20 20 two-dimensional array, board, of type int. An element board [i] Ij] is a

Write a program  Write a program Write a program that randomly generates a 20
20 two-dimensional array, board, of type int. An element board [i] Ij]

Write a program that randomly generates a 20 20 two-dimensional array, board, of type int. An element board [i] Ij] is a peak (either a maximum or a minimum) if all its neighbors (there should be either 3, 5, or 8 neighbors for any cell) are less than board ti] (11, or greater than board li] tjl. The program should output all elements in board with their indices, which are peak. It should also output if a peak is a maximum or a minimum. 24, The prototypes and main) function that you can use. const int ROWS 20 const int COLS 20 void fillBoardint b[IICOLSD void showBoard(int bOICOLS] void findPeakstint bI(COLS], int rows); int main4 int board ROWSIcOLS): fill Board(board): showBoard(board) findPeaks(board, ROWS systemf pausel return 0

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!