Answer the question
In order to leave comments, you need to log in
Why, when compiling a random array, with each subsequent compilation and run, the same numbers are displayed, and new ones are not generated?
#include <iostream>
#include <cstdlib>
#include <locale>
#include <conio.h>
#define SIZE 10
using namespace std;
void random_array(int array[SIZE]);
int main()
{
setlocale(LC_ALL, "rus");
int array[SIZE];
random_array(array);
getch();
return 0;
}
void random_array(int array[SIZE])
{
cout << "массив случайных чисел" << endl;
for (int i=0; i<SIZE; i++)
{
array[i] = rand()%100;
cout << array[i] << " ";
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question