You need to remember that an array holds values in its elements from 0 to size-1
in the case of random[50] the values of the numbers can be stored from random[0] to random[49]
for(counter; counter<50; counter++)//did not use counter as the array index
{
if(min>random[50]);//the 50th element is reserved for \0
min=random[50];
}
In your loops you did not try to access all the elements of the array
zeroliken
Veteran Poster
1,106 posts since Nov 2011
Reputation Points: 201
Solved Threads: 162
At line 13, you're also initializing min to the first (zero'th) element of the array before you've initialized the array. Instead, do the same thing, but immediately before the loop over the elements of the array where you're updating min (lines 29-34 above).
raptr_dflo
Practically a Master Poster
602 posts since Aug 2010
Reputation Points: 76
Solved Threads: 82