Possible Duplicates:
C++ random number generator without repeating numbers
Unique random numbers in O(1)?
I am doing as following
int y = arc4random() % 50;
I am using objective-c Now as I don't want same number again and again, like if 6 is once I get, then I don't need 6 again, because I am calling this line again and again and taking random numbers.