title: How would you code a program in Prolog to print numbers from 1 to 10 using recursion?
body: <p>How would you code a program in Prolog to print numbers from 1 to 10 using recursion?</p>
  
  <p>I've tried the following but it doesn't work, can you tell me why?</p>
  
  <pre><code>print_numbers(10) :- write(10).
  
  print_numbers(X) :- write(X),nl,X is X + 1, print_numbers(X).
  </code></pre>