The code was working fine until I added in a few arrays. Now an infinite loop occurs if the value of the for loop in the main () function is 12 or higher.
yeah its because monthlyrain is 11 elements wide and your loop runs 12 times,
and for some reason when you try to write to the twelfth element of monthlyrain x resets
rather than throwing an exception...wired
can someone explain that?