The numbers between 100 and 1000 inclusive that are exactly divisible by 12 do not sum to 41392, they sum to 41400:
108 120 132 144 156 168 180 192 204 216
228 240 252 264 276 288 300 312 324 336
348 360 372 384 396 408 420 432 444 456
468 480 492 504 516 528 540 552 564 576
588 600 612 624 636 648 660 672 684 696
708 720 732 744 756 768 780 792 804 816
828 840 852 864 876 888 900 912 924 936
948 960 972 984 996
So the problem is not the code, and is not "fixable" unless you can change the way teh universe works - the question is wrong!