In: Computer Science
In c++ seed the random number generator, one time only with 2020 . Create an array with 100 elements. Using a function fill the array with 100 numbers in the range of 101 - 199 that are based off the random number generator. Using a second function search the array and return the smallest value and the index of the element that contains the minimum value.
#include
#include
using namespace std;
void fillArray(int arr[], int size){
for(int i=0; i
}
}
int searchMinIndex(int arr[], int size){
int index = 0;
for(int i=1; i
return index ;
}
int main(){
srand(2020);
int arr[100];
fillArray(arr,100);
int minIndex = searchMinIndex(arr,100);
cout<<"Smallest Value in the array is
"<
return 0;
}
===================================================================