Couple of Histogram Problems

I have created a histogram program that has the user enter the lower limit of the range, then generates a 20 number array with that number at array[0] and the lower limit + 20 at array[20]. It then does a random number generation where 85% of the randoms are within the range and 15% are outside, and counts how many fall outside of the range. Then it counts occurances and prints a histogram that shows the amount below range, then prints the range (number, count, #'s or *'s), a # sign is printed for every 10 occurances that a number is counted and a * for every 1 after that 10 or if there are not 10 occurances. Just wanted to explain what the program did to allow for better knowledge of the situation.

Now, my problem is that whenever the user enters a negative number whose number does not fall into a positive range, such as user enters -50, creates a range of -50 to -30, as opposed to entering -10 and range is -10 to 10, there seems to be a problem with the randoms generating any occurances of the last 2-3 slots in the array, array[18 through 20], sometimes it's just the last 2, sometimes the last 3, never more than the last 3 slots though. I have tried many many negative numbers where the entire range stays negative and this happens to every one. Now if the range falls into positive, or even ends a 0 the randoms generate for the end of the array just fine and all goes well.

My other problem is that when the histogram generates an even 10, or multiple of 10, occurances for a specific number in the range, it will print out # signs then one *. So, if there are 10 occurances the histogram is showing 11, yet if there is 11 or 12, etc.. occurances then the histrogram prints out fine.

Any help and/or advice is greatly appreciated, sorry for the long post, my code is as follows:

I hate working with comparison with numbers in loops but it is sometimes so unavoidable!
Nice program.

Thanks for the help. The problem with the *'s and #'s has been taken care of, I can't believe that I didn't think of that, just had a lot going on and it didn't cross my mind. As for the first problem, changing rangeNums to 21 from 20 did not solve that problem at all. When I changed it and put in to start at -50 with 50 randoms generated, all of the randoms that it generated were positive and in the thousands, very random too, like one would be 2983 and another would be 5469, etc.. So, I am not sure why changing to 21 would have made that kind of drastic change but it did. Anyone have any idea as to how to fix this, I am exhausted on ideas and would like to get this program done and over with, this one has taken me way to long to complete and this is the only problem that I am experiencing then I'm done with it. Thanks for any help anyone can offer on this, and thanks for your help Dingbats.

I've read of this sort of problem before.
Just tried it with -50 and 50 and the results are "normal": as for others, for example -20 (and less) till 200 with various randoms - all "normal".
Sugestion:
copy everything from this project into a completely new project (different name, folder, etc) and then compile - don't ask me why: somebody else will have to answer that.

When it doesn't work >= sorry. I'm only a hobby writer and with my "corrections" it worked (works) fine.

I've read of this sort of problem before.
Just tried it with -50 and 50 and the results are "normal": as for others, for example -20 (and less) till 200 with various randoms - all "normal".
Sugestion:
copy everything from this project into a completely new project (different name, folder, etc) and then compile - don't ask me why: somebody else will have to answer that.

When it doesn't work >= sorry. I'm only a hobby writer and with my "corrections" it worked (works) fine.

Thank you very much for your help, even though your solution didn't work for me it got me to messing around with the other numbers some more and I managed to get it to work with:

I am pretty sure that I had tried this before with failure since it is the same as the statement above it, but I guess I hadn't. And since I was working with negatives I guess I assumed that it would have to be a - 1 instead of + 1. But thanks for your help and have a great night, marking thread as solved.