0

i'm writing a prolog code that will find the maximum number in a list , this is my code , it doesn't work , does anyone know where is the wrong

max([X],X).
max([H|T], M):-
    max(T , M1),
    T>=M1,
    M is T.
false
  • 10,264
  • 13
  • 101
  • 209
raghad
  • 21
  • 1
  • 5

0 Answers0