Answer:
The function in C++ is as follows:
void buildArray(int arr[], int n){
srand(time(NULL));
for(int i = 0;i<n;i++){
arr[i] = rand() % 99 + 10; }
for(int i = 0;i<n;i++){
cout<<arr[i]<<" ";
}
}
Explanation:
This defines the function
void buildArray(int arr[], int n){
This klets the program generate different random numbers
srand(time(NULL));
This iterates from 0 to n - 1 (n represents the length of the array)
for(int i = 0;i<n;i++){
This generates random 2 digit integer into the array
arr[i] = rand() % 99 + 10; }
This iterates through the array and print the array elements
for(int i = 0;i<n;i++){
cout<<arr[i]<<" ";
}
}
See attachment for complete program that includes the main