↧
Prolog program to Calculate factorial of N
We know the formula for calculating n! (factorial of n) is: n! = n * (n-1)! We can interpret this simple mathematical equation into a Prolog program. To do so, we must determine the basis of the...
View ArticleProlog program to find GCDs and LCMs
The least common multiple (LCM) of two integers a, b is the smallest positive integer that is a multiple of both a and b. Despite of the fact, there exist several formulas to calculate the LCM of two...
View ArticleList in Prolog
It is important for any programming tool to have some functionality of handling collections like array, list or something else. Prolog use lists for the very purpose and I must warn C/C++ programmers...
View Article