You might try Google.
'rand' returns an int value in some range. On MSVC it returns a number between 0 and 0x7FFF (32767).
Each time you call it, it returns a different number in a sequence that is pseudo-random. However, unless you use 'srand' to SEED the random sequence, it will always return the same sequence of numbers.
This can actually be a benefit, because you can write and test your program with rand and get the exact same sequence each time. Once you are happy with your program, introduce 'srand' to seed the number.
As a test, try this:
for (int i = 0; i < 100; i++) printf( "%d\n", rand() );
srand() takes an arg that is the seed value, and possible seeds are things like time:
srand( time(NULL) );
Internally the number is generated this way under MSVC, so you can see it is both simple and repeatable:
return(((holdrand = holdrand * 214013L + 2531011L) >> 16) & 0x7fff);
There are much more 'random' random number generators used in encryption, but this should do for now!