I am trying to write a program that gives a list and back a newer list that have even numbers in the first list, as below:
evennom([1,3,2,4,3,2,1,2],out)
out = [2,4,2,2]
My Code is as below:
evennom([],[]).
evennom(H1|T1],[H2|T2):- H2 is H1 mod 2.