Write a program that reads a list of strings and then selects and prints a random string from the list. To select a random element of
@somearray
, put
srand;
at the beginning of your program (this initializes the random number generator), and then use
rand(@somearray)
where you need a random value between 0 and 1 less than the length of
@somearray
.