#include <codecogs/finance/accounting/deprecstraight.h>
using namespace Finance::Accounting;
| double | deprecStraight (double cost, double salvage, int life) Calculate the straight-line depreciation of an asset.
Excel: SLN | |
| Real | cc_accountingDeprecStraight (Real cost, Real salvage, Integer life) This function is available as a Microsoft Excel add-in. |
| doubledeprecStraight( | double | cost | |
| double | salvage | ||
| int | life | ) |
#include <iostream> #include <codecogs/finance/accounting/deprecstraight.h> int main(int argc, char *argv[]) { printf("Depreciation of an asset purchased for 30000,"); printf("and salvage for 7500 after 10 years is:\n"); std::cout<<Finance::Accounting::deprecStraight(30000, 7500, 10); std::cout<<std::endl; return 0; }Output:
Depreciation of an asset purchased for 30000, and salvage for 7500 after 10 years is: 2250
| cost | The initial cost of the asset. |
| salvage | The value at the end of the depreciation. |
| life | The number of periods over which the asset is being depreciated, i.e. the useful life of the asset. |