Calculation of depreciation by using straight Line method ( SLM )
Enter cost, rate of depreciation and number of years. Display depreciation for each year by straight line method.
#include< #include< void main( ) { float cost, rate, year, dep, cnt; clrscr( ); printf("Enter Cost, Dep.Rate, Years"); scanf("%f %f %f ", &cost, &rate, &year); dep = cost*rate/100; for(cnt=1; cnt < = year; cnt++) { printf("\n Year %f, Depreciation %.2f\n", cnt, dep); } getch( ); } |
---|
0 comments:
Post a Comment