Ok I can't give you the answer, but here is what a programming instructor once told me:

"Inside the loop, you multiply the counter times the accumulated number up to that point (the accumulator has to be initialized to 1 before the loop). So if the user enters a 3--The first time through the loop, the counter is 1, so 1 * the accumulator 1 is 1. Second time through the loop, the counter is 2, so 2 * the accumulator 1 is 2. Third time through the loop, the counter is 3, so 3 * the accumulator 2 is 6. This is where the loop ends, and after the loop, 6 would be displayed as the answer."

huh?? what does this most incoherent mess of pseudo-code mean? this is garbage.

in easy words we can simply write the algorithm as:

1.set a variable to be 1

2.scan the no from user for which he needs the factorial.

3.inside the loop

a. set the loop to run n-1 times where n is the no inputted by user

b.then start multiplying the variable which was declared as 1 with the one used in loop.

4.show the result.

its so simple try it .i can understand your problem as i was also stuck in a problem like this few weeks ago. hope you understand all this written above.