Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

rand() c++

/* rand example */
#include <stdio.h>      /* printf, scanf, puts, NULL */
#include <stdlib.h>     /* srand, rand */
#include <time.h>       /* time */
/* initialize random seed: */
srand (time(NULL));
/* generate  number between 1 and 10: */
random_number = rand() % 10 + 1;
Source by www.cplusplus.com #
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
6+6 =