Answer to Question 10A-1

Here is the loop for reference.

  int r = 1;
  int n = 1;
  while(n < 5)
  {
    n = n + 1;
    r = n * r;
  }
n r
1 1
2 2
3 6
4 24
5 120

The last line occurs when the loop reaches its top and decides not to do its body any more times.