Given that a certain amount of money becomes T1 times itself in N1 years. The task is to find the number of years i.e. N2 so that the amount becomes T2 times itself at the same rate of simple interest.
Input: T1 = 5, N1 = 7, T2 = 25
Input: T1 = 3, N1 = 5, T2 = 6
Let us consider the 1st Example where T1 = 5, N1 = 7, T2 = 25
Now, Let P principal becomes 5P i.e (T1 * P) then Simple interest received is 4P.
(As S.I = Amount – P)
Now, in the second case, P has become 25P i.e (T2 * P) then simple interest received is 24P.
Now if we received 4P interest in N1 i.e 7 years then we will get an interest of 24P
in 7 * 6 years i.e in 42 years.
Below is the implementation of the above approach:
GeeksforGeeks has prepared a complete interview preparation course with premium videos, theory, practice problems, TA support and many more features. Please refer Placement 100 for details
- Sum of all numbers formed having 4 atmost X times, 5 atmost Y times and 6 atmost Z times
- Simple Interest
- Program to find simple interest
- Difference between two given times
- Find the value of N XOR'ed to itself K times
- How to print N times without using loops or recursion ?
- Probability of getting a sum on throwing 2 Dices N times
- Find the value of XXXX.....(N times) % M where N is large
- GCD of two numbers formed by n repeating x and y times
- First element that appears even number of times in an array
- Convert a number of length N such that it contains any one digit at least 'K' times
- Check if X and Y can be made zero by using given operation any number of times
- Find Nth smallest number that is divisible by 100 exactly K times
- Count different numbers possible using all the digits their frequency times
- Number formed by adding product of its max and min digit K times