Skip to main content

Command Palette

Search for a command to run...

Project Euler - Problem 1

Published
1 min read
' https://projecteuler.net/problem=1

sub main()

    sum = 0

    for i = 1 to 999
        if mult3(i) or mult5(i)
            sum = sum + i
            print i, sum
        end if
    end for

end sub


function mult3(i) as boolean
    return (i mod 3) = 0
end function

function mult5(i) as boolean
    return (i mod 5) = 0
end function