That random number is generated because you're printing the result of a function which is supposed to return an int, but actually returns nothing.