I'm a first year CS student, with no prior knowledge in programming. I was recommended to go through the problems of Project Euler, and have managed to solve (almost) the first problem.
It states that you have to sum all the numbers which is a multiple of either 3 or 5 (or both).
My code in F#:
let mutable n = 0
for i in 0..1000 do
if (i % 3 = 0) || (i % 5 = 0) then
n <- i + n
printfn "%A" n
When this is run, I get answer 234168 which is off by 100 of the real answer.
Any suggestion why?