loops and answers

Im having trouble setting up a loop where an answer got is used again next in the loop.Can anyone write any simple code of your choice for me Thanks.or maybe 1*2 the answer multiplied by 3 then answer by 4,ans *5,ans *6...
Last edited on
1
2
3
4
5
6
7
int answer = 1;

for (int i = 1; i < 11; i++)
{
  answer = answer * i;
}
  
Topic archived. No new replies allowed.