title: Prolog program to reverse and append the list
body: <p>I am new to prolog. I am trying to reverse the order of list and append them.</p>
  
  <p>For example :</p>
  
  <p>revappend([1,2], [3,4], X) Should give me result like : </p>
  
  <p>X = [3,4,1,2]</p>
  
  <p>The code I wrote :</p>
  
  <pre><code>revappend([],List,List).
  revappend(InputListB,[Head|InputListA], [Head|OutputList]):-
     revappend( InputListA, InputListB, OutputList).
  </code></pre>
  
  <p>Giving me result like :</p>
  
  <p>X = [15, 11, 16, 12, 13, 14]</p>
  
  <p>Can someone tell me how to do this??</p>