I would like to create a array having 21 values between 0 to 20.I would like them to be in random and at the same time non-repeated.
I know how to create a random number
It sounds like you're making it harder than necessary. Why don't you create an array of the numbers 1-20, and then randomize it through a shuffle.