c 2b 2b determine the start and end of the random number

Solutions on MaxInterview for c 2b 2b determine the start and end of the random number by the best coders in the world

showing results for - "c 2b 2b determine the start and end of the random number"
Serena
19 Apr 2018
1#include <iostream>
2#include <cstdlib>
3#include <ctime>
4using namespace std;
5
6int main()
7{
8	srand(time(0));
9
10	for (int i = 0; i <= 10; i++)
11	{
12		int start = 3;
13		int end = 8;
14		cout << start + rand() % (end - start + 1);
15	}
16}