How do I generate a random number between two variables that I have stored? [duplicate] August 10, 2023 by Tarik To generate a random number between min and max, use: int randNum = rand()%(max-min + 1) + min; (Includes max and min)