can't visualize how to do his with code

I am new to coding and am trying to expand my skills and checked out project euler.

How in the world do I calculate all the multiples of 3 and 5. I am pretty sure I could add them but, I am lost. Please go easy on the noob.
all the multiples of 3 and 5 until infinity?
or is there a limit?
I wont tell you exactly how to do it as that will take the fun away, but I will tell you the 2 things you need to understand to accomplish it.

For loops to go through all the numbers you need to check (if I remember it's 0 - 1000 for project euler)
http://www.cplusplus.com/doc/tutorial/control/

Also you will need to understand modulus to make it simple.
http://www.cplusplus.com/reference/std/functional/modulus/
the modulus (%) can be used to find the remainder of a division.
for example:

 
if(x%5==0)  //if x is a multiple of 5, then the remainder will be 0, and the condition will be true 


you can then envisage something like this:

1
2
if(x%5==0 && x%2==0)   //if x is both a multiple of 5 and 2 then this condition will be true
cout<<"x";                       


you can then put this into a for loop for it to test every number until infinity (or until you close the program )
THank you, Thank you, thank you, thank you. I hate it when I hit road blocks. now i have somewhere to go.
Topic archived. No new replies allowed.