you will want to have the user input the number, then run a loop from 1 to that input.
Inside that loop you will want to create your product value, and then after that output it.
with a function I would just set the loop inside the function, and pass the user input.
This sounds like a homework question to me, and I will be glad to assist you, but believe me this stuff doesn't get easier and you will want to learn and comprehend this simple stuff now.