c++ Determine the start and end of the random number code example
Example: c++ Determine the start and end of the random number
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
int main()
{
srand(time(0));
for (int i = 0; i <= 10; i++)
{
int start = 3;
int end = 8;
cout << start + rand() % (end - start + 1);
}
}