how to generate random numbers in c++ between two numbers code example Example: how to get a random number between two numbers in c++ int randNum = rand()%(max-min + 1) + min;