So then why are you starting your arrays at 1?
While Archimedes was incorrect about the function of the loop, he did correctly diagnose your original problem of starting your array at the wrong point and thus, missing several int's when counting the number of set 1's. Please note that because you start at 1 in your first array as well, you never completely initialize your array properly. Your last comments seem a bit hostile to people who are trying to help you solve your problem and in my opinion, have done so at this point.
Bookmarks