title: Find minimum and maximum of a list in Prolog
body: <p>Below is my program.
  Individually.... max and min functions works, but when I combine them using minmax, it is throwing the error.</p>
  
  <pre><code>max([H|T], M) :- max(T, H, M).
  
  max([], M, M).
  max([H|T], Y, M) :- H =&lt; Y, max(T, Y, M).
  max([H|T], Y, M) :- H &gt; Y, max(T, H, M).   
  </code></pre>
  
  <p>till here max code works individually</p>
  
  <pre><code>min([H|T], M) :- min(T, H, M).% \+ means "not"     //// min code starts
  
  min([], M, M).
  min([H|T], Y, M) :- H =&lt; Y, min(T, H, M).
  min([H|T], Y, M) :- H &gt; Y, min(T, Y, M).      /// till here min code works
  
  minmax([H|T],[max(T,H,M),min(T,H,M)]).     /// this is statetment with problem
  </code></pre>