rand() and srand()

how can I get a number at random
from the following set of numbers
which are not consecutive .
2,4,6,8,10

Thanx
 
(1+rand()%5) * 2;
Last edited on
Topic archived. No new replies allowed.