Write your question here.
I am a bit surprised that unsigned int generates unusually high numbers way above its limits. Random numbers are in tens of millions, whereas unsigned int's value should not exceed 65535. What am I doing wrong? Thank you
You are mistaken that unsigned int should not exceed 65535. That is the MINIMUM maximum for an unsigned int. It would have that maximum if it was 2 bytes. But ints are usually at least 4 bytes and could even be 8 bytes. At 4 bytes the maximum value is 4294967295 and for 8 bytes it's 18446744073709551615.
It is a surprise, cause tutorial I am using stated this:
"The standard function rand() is called without any arguments and returns a random
number between 0 and 32767. A series of random numbers can be generated by repeating
the function call."
So, nothing wrong with this code. Thank you for answers.