The value of any article or item subject to wear and tear, decreases with time. This decrease is called its Depreciation. Given three variable V1, R and T where V1 is the initial value, R is the rate of depreciation and T is the time in years. The task is to find the value of the item after T years.
Examples: 
 
Input: V1 = 200, R = 10, T = 2Â
Output: 162
Input: V1 = 560, R = 5, T = 3Â
Output: 480.13Â
Â
Â
Approach: As in Compound Interest, interest is regularly added to the principal at the end of the agreed intervals of time to generate a new and fresh principal. Similarly, Depreciated value is the decreased value from the amount at the end of agreed intervals of time to generate a new Value.
Thus if V1 is the value at a certain time and R% per annum is the rate (the rate can not be more than 100%) of depreciation per year, then the value V2 at the end of T years is: 
 
Below is the implementation of the above approach : 
 
C++
| // CPP program to find depreciation of the value// initial value, rate and time are given#include <bits/stdc++.h>usingnamespacestd;  // Function to return the depreciation of valuefloatDepreciation(floatv, floatr, floatt){      floatD = v * pow((1 - r / 100), t);      returnD;}  // Driver Codeintmain(){    floatV1 = 200, R = 10, T = 2;      cout << Depreciation(V1, R, T);      return0;} | 
Java
| // Java program to find depreciation of the value// initial value, rate and time are givenimportjava.io.*;  classGFG{  // Function to return the depreciation of valuestaticfloatDepreciation(floatv,                           floatr, floatt){    floatD = (float)(v * Math.pow((1- r / 100), t));      returnD;}  // Driver code publicstaticvoidmain(String[] args){    floatV1 = 200, R = 10, T = 2;    Â    System.out.print(Depreciation(V1, R, T)); } }  // This code is contributed by anuj_67.. | 
Python3
| # Python 3 program to find depreciation of the value# initial value, rate and time are givenfrommath importpow  # Function to return the depreciation of valuedefDepreciation(v, r, t):    D =v *pow((1-r /100), t)      returnD  # Driver Codeif__name__ =='__main__':    V1 =200    R =10    T =2      print(int(Depreciation(V1, R, T)))  # This code is contributed by# Surendra_Gangwar | 
C#
| // C# program to find depreciation of the value// initial value, rate and time are givenusingSystem;  classGFG{  // Function to return the depreciation of valuestaticfloatDepreciation(floatv, floatr, floatt){      floatD = (float) (v * Math.Pow((1 - r / 100), t));      returnD;}  // Driver code publicstaticvoidMain(){    floatV1 = 200, R = 10, T = 2;    Â    Console.WriteLine(Depreciation(V1, R, T)); } }  // This code is contributed by nidhiva | 
Javascript
| // javascript program to find depreciation of the value// initial value, rate and time are given  // Function to return the depreciation of value functionDepreciation( v,  r,  t){  Â    varD =  v * Math.pow((1 - r / 100), t)    returnD;}  Â// Driver code     varV1 = 200,  R = 10,  T = 2;    document.write(Depreciation(V1, R, T));   // This code is contributed by bunnyram19.   | 
162
Â
Time Complexity: O(1)
Auxiliary Space: O(1)
Ready to dive in? Explore our Free Demo Content and join our DSA course, trusted by over 100,000 neveropen!

 
                                    








