programming-examples/c/Numerical/C Program to Generate Randomized Sequence of Given Range of Numbers.c
2019-11-15 12:59:38 +01:00

21 lines
419 B
C

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
const int LOW = 1;
const int HIGH = 32000;
int main()
{
int randomNumber, i;
time_t seconds;
time(&seconds);
srand((unsigned int) seconds);
for (i = 0; i < 10; i++)
{
randomNumber = rand() % (HIGH - LOW + 1) + LOW;
printf("%d ", randomNumber);
}
printf("...");
return 0;
}