#include<iostream>
#include<cstdlib>
usingnamespace std;
int main()
{
int random[5];
int biggest = 0;
int smallest = 100;
for(int i=0;i<5;i++)
{
random[i] = (rand()%7)+7;
if(random[i]>biggest)
biggest=random[i];
if(random[i]<smallest)
smallest=random[i];
}
for(int x=0;x<5;x++){
cout<<"Index "<<x<<" - - "<<random[x]<<endl;
}
cout<<"The biggest value of the array is "<<biggest<<endl;
cout<<"The smallest value of the array is "<<smallest<<endl;
return 0;
}
You can change the array to however many rand numbers you want, given you also change the for loops. This is the basics of this.