Write a prolog program that reads an integer x and a list


Write a Prolog program that reads an integer x and a list of integers L, then locates the list of all positions of x in L, and returns the resulting list.

For example, for x=2 and L=[1,2,3,4,2,5,2,6], the program should return the list R=[1,4,6].

Note: If your compiler counts the positions starting from one, the result will be R=[2,5,7].

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Write a prolog program that reads an integer x and a list
Reference No:- TGS0137501

Expected delivery within 24 Hours