Hi Alice,
Daniel is of course correct, and perhaps has better sense than I do in that he gave you a direct answer to your question. But I would also like to point out that Mathematica offers a significantly different paradigm in programming compared to mainly procedural languages like C. It does of course have Do, For, and While -- and these are still useful in some calculations, especially where results are built up in an iteration, like you are doing calculating N factorial.
But I usually call Mathematica a 10th generation language. (I started calling it that somewhere around V4, so maybe I should increment that!) As an example, below are a few more ways to calculate N Factorial.
Kind regards and enjoy Mathematica,
David
In[1]:= (* by recursion *)
fact1[1] = 1;
In[2]:= fact1[n_] := n fact1[n - 1];
In[3]:= fact1[3]
Out[3]= 6
In[4]:= (* by Apply *)
fact2[n_] := Times @@ Range[1, n]
In[5]:= fact2[3]
Out[5]= 6
In[6]:= (* and of course by built in *)
Factorial[3]
Out[6]= 6
In[7]:= (* or *)
3!
Out[7]= 6