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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started