I suppose the first question is whether you're learning C or C++.

You posted on the C++ forum, and your fuzzy filename is a .cpp file.

But the code is pure C.



Your inner loop to check for duplicates needs to be something like
Code:
// check the new number with all previous numbers
for ( j = 0 ; j < i ; j++ ) {
  if ( lotto[i] == lotto[j] ) // it's a duplicate
}