Question: Write a C++ program to do the following tasks: a. Create a table that contains 500 random numbers in the range of 0 100, which
Write a C++ program to do the following tasks:
a. Create a table that contains 500 random numbers in the range of 0 100, which are
arranged in 50 rows and 10 columns format. Store the contents in a two-dimensional
array.
b. Ask the user to enter an integer.
c. Search the integer through the array. Defifine a function as follow to perform the search.
bool searchArr(int n, int array[ ][COL], int& rN, int& cN)
Here, bool means variables with this data type will have only two values, true or false.
n is the integer which entered by the user. This function will check if n exist in the
array. rN, cN are row and column numbers where n is found. Note that the row and
column start counted from 1, instead of 0.
d. If the integer is found in the array, print the row and column number respectively.
When printed, the row and column numbers are counted from 1, instead of 0.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
