Program to generate random list of number 1..n

Knuth suffle Algorithm:
1)take a variable len which point towards the end of the array
2)while len>0 ,generate a random number from 0-len.
3)now swap the a[i]th element and a[len-1] element
4)decrement the vlaue of len so that next time we will choose the unique element from the array