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 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
Get step-by-step solutions from verified subject matter experts
