programming-examples/c++/Numerical_Problems/C++ Program to Generate Randomized Sequence of Given Range of Numbers.cpp
2019-11-18 14:44:36 +01:00

26 lines
511 B
C++

#include <iostream>
#include <cstdlib>
#include <time.h>
const int LOW = 1;
const int HIGH = 32000;
using namespace std;
int main()
{
int randomNumber;
time_t seconds;
time(&seconds);
srand((unsigned int) seconds);
for (int i = 0; i < 10; i++)
{
randomNumber = rand() % (HIGH - LOW + 1) + LOW;
cout << randomNumber << " ";
}
cout << "...";
return 0;
}
/*
312 7423 23444 16008 31816 1823 29315 17424 11753 18384 ...