If I want to generate 10 random numbers ranging from 0 to 9, is it possible to have 10 different numbers every time? For example, every time they should be like this, 1,3,4,9,0,2,8,7,5,6 without duplicate. I tried srand and rand but it looks like it doesn't work. They simply will generate duplicate numbers. Thanks for your inputs.