Q2. Write a program to find the Fibonacci series of the number being entered. Test it for number 10.
PREDICATES
fibo(integer,integer)
CLAUSES
fibo(0,0).
fibo(1,1).
fibo(N,F):-N>0,N1=N1,N2=N2,fibo(N1,F1),fibo(N2,F2),F=F1+F2.
GOAL
fibo(10,F).
Subscribe to:
Post Comments (Atom)
variable used twice error in goal
ReplyDelete