Calculate Depreciation using C



Sumit Kar, Sorting, C, Timus Rak, C Program



#include<conio.h>
#include<stdio.h>
void main()
{
float sv,pv,dep;
int yos;
clrscr();

printf("Enter the purchase value :- ");
scanf("%f",&pv);

printf("Enter the year of service :- ");
scanf("%d",&yos);

printf("Enter the value of depreation :- ");
scanf("%f",&dep);


sv = pv - (dep * yos);
printf("\n The salvage value equal to :- %f",sv);

getch();
}

/*
Summary: Compute the yearly depreciation of the value of an item, given by Depreciation = (PURCHASE VALUE - SALVAGE VALUE) / YEAR OF SERVICE
*/


Comments

Popular posts from this blog

Write a Program to Add two 3x3 Matrix using C

C program for Unit Conversion

Write a Program to Add two 5x5 Matrix using C