srand ( time (NULL) ); // Initialize random generator value = rand()%MAX_RANGE+1; // Get random between 1 and MAX_RANGE