1. Exercise:
. Write a predicate called sum_of that works exactly like
length_of, except that it takes a list of numbers and adds them
up.
For example, the goal:
sum_of([1, 2, 3, 4], S).
should bind S to 10.
Program:
Output:
2. Write a complete Programe in Prolog to find result of this
seqence
S=1+2+3+...+N
Program:
Output:
ASmaa Almalki