Answers for "c++ Determine the start and end of the random number"

C++
0

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);
	}
}
Posted by: Guest on April-25-2021

Code answers related to "c++ Determine the start and end of the random number"

Browse Popular Code Answers by Language