How can one generate multiple random values using rand()?