Random number generator (included) by language
rosettacode.org
rosettacode.org
Fortran has multiple compilers, and the standard does not prescribe the algorithm for RNG to be used. I imagine the situation is similar for C and C++.
#define RAND_MAX 32767
int rand (void){return 0;}
(Edit: changed RAND_MAX from zero. That can’t be zero, but I think rand is allowed to be spectacularly bad)is a valid implementation.
In real life, implementations are a bit better. The small seed (just a single int) can’t make it much better, though.
The original version also is a LCG, so it has the nasty habit of very short cycle lengths when only looking at least significant bits.
C++ has multiple well-defined engines (https://en.cppreference.com/w/cpp/numeric/random)