GDP (Gross Domestic Product) measures the total value of goods and services produced within a country's borders, regardless of the nationality of the people or businesses producing them.
GNP (Gross National Product), on the other hand, measures the total value of goods and services produced by the citizens and businesses of a country, regardless of where they are located in the world. It includes the income earned by citizens and businesses abroad, and subtracts the income earned by foreigners within the country.
To calculate GNP, you need to add net factor income from abroad (income earned by citizens and businesses abroad minus income earned by foreigners in the country) to GDP. Additionally, you need to subtract public transfer payments (such as social security payments) and add consumption of fixed capital (the depreciation of physical assets like buildings and equipment).
In summary, GDP measures the total value of goods and services produced within a country's borders, while GNP measures the total value of goods and services produced by the citizens and businesses of a country, both within and outside of its borders, while taking into account various adjustments such as net factor income from abroad, consumption of fixed capital, and public transfer payments.