In previous article we have seen how to get factorial of a number. In this article, we will see program of how to calculate population density of a country. It is a simple program and easy to use.
PROGRAM:
country(india). population(india,12370000000). area(india,3287590). density(X,Y):-population(X,P),area(X,INDIA),Y is P/INDIA.
OUTPUT: