>> return x[(count2)+1];
the above is on the inside of the loop so the loop will only run once.
>>for (count = 0;count <= 20;count++)
this loop will count one too many times. the array only has 20 elements but the loop will run 21 times.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2283
Retired and Enjoying Life
Offline 21,961 posts
since Aug 2005