i have an array with 12 objects {0,1,2,3,4,5,6,7,8,9,10,11}
from this array i have to pick 6 values randomly,but they are unique not repeated.
i am using this
for (int i =0; i<6; i++)
{
NSLog(@"%d",rand()%12);
}
it gets as 7 1 5 2 10 8
for second time it gets as 0 2 11 1 0 5,Here 0 is repeated.But i always need as my first output means values are not repeated.
how can i done,
can any one please help me.
Thank u in advance.