I think you've gotten something switched in your head. >_>
What goes between the brackets is the index of the element of the array you want to access (0 - 4 in this case). a[i] is the element of the array at index i.
I'm assuming your code was supposed to look through the 5-element array and get the index of an element whose value matches TheNum. If so, then lines 14 and 15 need changing. You just need to switch two things in those lines (but not the whole lines).