generate random number in interval c++ code example
Example 1: c++ how to generate a random number in a range
min + ( std::rand() % ( max - min + 1 ) )
Example 2: c rand range
rand() % (max_number + 1 - minimum_number) + minimum_number
min + ( std::rand() % ( max - min + 1 ) )
rand() % (max_number + 1 - minimum_number) + minimum_number