/* * example of a pseudo-rando number generator (PRNG) * the seed is the default (that is, 1, according to the manual) * * Matt Bishop, ECS 36A * -- May 22, 2024 original program */ #include #include /* * prototypes */ long random(void); /* manual says this is in stdlib.h but apparently not */ /* * here we go! */ int main(void) { int i; /* counter in a for loop */ /* * print the first 20 pseudo-random numbers */ for(i = 0; i < 20; i++) printf("%3d.\t%10ld\n", i+1, random()); /* adios! */ return(0); }