How i can find duplicated numbers in an array.

#1.I have a rand() function that assign numbers in an array.

#2.I want to find if there are at least 2 duplicated numbers,
unfortunately i dont know how ... can you give me your suggestions plz...