Challenge 1:
'If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3,5,6 and 9. The sum of these multiples is 23.
Find the sum of all the multiples of 3 or 5 below 1000.'
Simple solution in MATLAB:

Simple solution in C:

Both programs return the answer as 233,168.
Conclusion: A very simple first challenge, to ease me into things.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.
It would make it more interesting to eliminate the mod operation which is more costly than adds and subtracts on most machines.
Are you sure? yes | no