#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define SIZE 7
int getRandom(const int min, const int max) {
return (rand() % (max - min + 1)) + min;
}
void GenerateNRandomNumbers(const int N, int array[], const int min, const int max) {
for (int i = 0; i < N; i++) {
array[i] = getRandom(min, max);
}
}
int main(void) {
srand(time(NULL));
int array[SIZE];
const int N = SIZE;
GenerateNRandomNumbers(N, array, 1, 30);
for (int i = 0; i < N; i++) {
printf("%d ", array[i]);
}
return 0;
}
/*
run:
14 26 5 14 11 19 4
*/