Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

c++ rand

#include <ctime>

int main() {
 srand((unsigned) time(0)); 
 int result = 1 + (rand() % 6); // return a number between 1 and 6
}
 
PREVIOUS NEXT
Tagged: #rand
ADD COMMENT
Topic
Name
6+5 =