This is basically how you would do it. For rand(), whatever number you put after the plus sign is what the lowest number it will ever give you. The number before the modulus operator is the highest number it will ever give you.
#include <time.h>
#include <stdlib.h>
int main()
{
srand(static_cast<unsigned int>(time(0)); // Seed the random number generator
int randomNum = rand() % 10 + 1; // Random number between 1 and 10
}