0
8.2kviews
Write a PROLOG program to find Fibonacci series.
1 Answer
written 7.9 years ago by | • modified 7.9 years ago |
$\boxed{domains \ \hspace{1cm} x = integer \ predicates \ \hspace{1cm} fibonacci(x) \ clauses \ \hspace{1cm} fibonacci(1). \ \hspace{1cm} fibonacci(N) :- \ \hspace{2cm} N1 = N-1, \ \hspace{2cm} N1 >= 0,!, \ \hspace{2cm} fibonacci(N1), \ \hspace{2cm} write(F1,” ,”), \ \hspace{2cm} F= F1+N.}$