You are currently viewing Program to find the population density of the country in prolog.

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:

 

Dinesh Kumar Bansal

Dinesh Kumar Bansal is an Indian Software Developer, who is working on ASP.Net, MS-SQL, SAP-ABAP technologies from last one year. His Basic Principle of developing software is, “You have to clear about, what do you want to do, how can it be done”. He always says that development can be done with a cool & fresh mind.

Leave a Reply