since everyone did factorial 1 to 10, which is the challenge, i decided to go off the menu and show how to do factorial 0 to 10, which requires a little more code to accomplish.

Code: (Objective-C)

int x;

for (x=0; x<=10; x++) { int y =1, n = x; while (n) y *= n--;

NSLog(@"%2d, %d",x,y); }

I like that style. I'm going to check this out and see what the results are. In the meantime, I did similar to what OP did, but using "the first ten" ie. 0-9. I had to look to the forums and realized that my problems were solved after I took the NSLog out of the nested for loop and added the factorial=1; to reset it each time.