The simplest way is to loop through all the numbers up to the user's input.
If the input is divisible by a number, output it.
If you need more help, show some effort.
Don't forget to use the force...I mean code tags.
Friendship is magic!
R.I.P. Tracy M. You will be missed.