>range [0,100]?
Just making sure, you want the range of 0 to 100, including both 0 and 100? There's a difference between [0,100] and [0,100), and that changes the code. For the latter it would be this:

You should revisit definition the of rand() and srand() functions,
both will give you non-repeating random numbers from 0 to your system's 'randmax' value.
Just use the standard form of rand() with a 'shift' and 'scale factor',eg:
number = shift value + rand() % scaling factor;
// shift value = minimum number
// scale factor = repeat point (What ever the modulus is chosen to be.)
For your code, simply populate your array with the numbers returned from the computation.
If your for loop conitunation limit is greater than the (shift value + scale factor), then the numbers will repeat in that range.

Try to keep your code simple, as you don't really need '2' for loops and all those 'if' tests.
Nice try just the same.

>both will give you non-repeating random numbers from 0 to your system's 'randmax' value.
Sorry, but that's incorrect. First, srand doesn't give you random numbers at all, it seeds the generator for rand to give you random numbers. Second, rand is not only allowed to repeat numbers, the very definition of random numbers makes repeating values expected.

Your solution doesn't address the problem, which is, for example, in the range of [0,100) the value 50 may appear more than once.