the problem is the following I have my code in which 10 random numbers are generated in an array, then it shows them and then it orders them, what I want is that when re-executing the "fill" function, which is the one that generates the numbers an array is generated with new numbers and they are not the same as the previous time.
#include<iostream>
#include <stdlib.h>
#include <time.h>
using namespace std;
int llenar();
int mostrar();
int array[10];
int burbuja();
int main(){
llenar();
mostrar();
burbuja();
llenar();
mostrar();
};
int burbuja(){
int i,j,aux;
for(i=0;i<10;i++){
for(j=0;j<10;j++){
if(array[j] > array[j+1]){
aux = array[j];
array[j] = array[j+1];
array[j+1] = aux;
}
}
}
for(i=1;i<11;i++){
cout<<array[i]<<" ";
}
cout<<endl;
}
int mostrar(){
for(int i=0; i<10; i++){
cout << array[i] << " ";
}
cout<<endl;
};
int llenar(){
array[0]='NULL';
int num, c;
srand(time_t());
for(c = 1; c <= 10; c++)
{
array[c-1] = 1 + rand() % (100 - 1);
/* cout << array[c-1]<< " ";*/
}
return 0;
}