The seed value determines the initial state of the pseudorandom number generator (PRNG), which in turn determines which sequence of pseudorandom numbers is generated. Thus, you use srand() to seed and rand() to obtain the next number in the sequence. In your example, you do not use srand() at all, so the PRNG is seeded as if you wrote srand(1).

Also, read Prelude's article on using rand().