array search problems

NEWB alert, lol. This was homework that I failed because i didnt turn it in on time. I didnt turn it in due to the fact that i took an online course, my book sucks and my instructor only checks his e-mail once a wk. that and i couldnt for the life of me figure out why my search "for loop" in my printInt function wont return the proper count. everything compiles o.k. my loop looks exactly like the one in the book and the online lecture. If someone can point out my mistake so i can use it properly next time i would be very grateful.
my whole program:

with limited knowledge of your problem combined with other generalities (such as your 'for loop') one guess i would make is that your loop condition in line #12 seems suspicious. since array elements are zero based, it is somewhat uncommon to see size-1 as a loop condition. this could cause you to examine one less element in your array and therefore return results less than what you would expect.

with limited knowledge of your problem combined with other generalities (such as your 'for loop') one guess i would make is that your loop condition in line #12 seems suspicious. since array elements are zero based, it is somewhat uncommon to see size-1 as a loop condition. this could cause you to examine one less element in your array and therefore return results less than what you would expect.

that is purposeful actually. my array size is 21 but i only want to search through 20 cells. the 21st cell is the random number im trying to count.

These two explanations are sort of contradictory. So, is it equal, or is it increased by?

So back to base 1, can you explain the plus sign. And I don't mean syntax. I mean, why did you put it there?

its not contradictory you need to read up on your c++ obviously. very common use as is "index++" for example, that is an increment. ive already explained why its there. does anyone actually " help" on this forum?