Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

random in c++

#include <iostream>
#include <stdlib.h>     
#include <time.h> 
using namespace std;

int main()
{
	int num;
	srand(time(0));
		num = rand() % 10 + 1;
		cout << num << endl;
}
 
PREVIOUS NEXT
Tagged: #random
ADD COMMENT
Topic
Name
8+7 =