Sadly the libc prng is not specified, and thus non-portable. It might work if things are checked on the same kernel and libc combination, or it might not. The Java PRNG is specified and globally portable.
I was thinking more along the lines of making the main function (array) call some other function which does this in such a way that it looks like you implemented a random number generator but it actually prints "Hello World". And you could hide the fact that 'main' was a piece of code by making it the initial seed for for the random number generator and using macros in a separate header file to rename it to something like 'SEED'.