Question: Modify the program and get an integer value from the user and search whether the number is present in the array or not #include //Line

Modify the program and get an integer value from the user and search whether the number is present in the array or not

#include //Line 1

#include //Line 2

using namespace std; //Line 3

void fill(int **p, int rowSize, int columnSize); //Line 4

void print(int **p, int rowSize, int columnSize); //Line 5

int main() //Line 6

{ //Line 7

int **board; //Line 8

int rows; //Line 9

int columns; //Line 10

cout \"and>

cin >> rows >> columns; //Line 12

cout

//Create the rows of board

board = new int* [rows]; //Line 14

//Create the columns of board

for (int row = 0; row

board[row] = new int[columns]; //Line 16

//Insert elements into board

fill(board, rows, columns); //Line 17

cout

//Output the elements of board

print(board, rows, columns); //Line 19

return 0; //Line 20

} //Line 21

void fill(int **p, int rowSize, int columnSize)

{

for (int row = 0; row

{

cout

for (int col = 0; col

cin >> p[row][col];

cout

}

}

void print(int **p, int rowSize, int columnSize)

{

for (int row = 0; row

{

for (int col = 0; col

cout

cout

}

}

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 Programming Questions!