Given a container that has X liters of milk. Y liters of milk is drawn out and replaced with Y liters of water. This operation is done Z times. The task is to find out the quantity of milk left in the container.
Input: X = 10 liters, Y = 2 liters, Z = 2 times Output: 6.4 liters Input: X = 25 liters, Y = 6 liters, Z = 3 times Output: 10.97 liters
Below is the required implementation:
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Find amount to be added to achieve target ratio in a given mixture
- Next greater Number than N with the same quantity of digits A and B
- Smallest length string with repeated replacement of two distinct adjacent
- Minimum replacement of pairs by their LCM required to reduce given array to its LCM
- Find array sum using Bitwise OR after splitting given array in two halves after K circular shifts
- Program to find the time after K minutes from given time
- Program for Area Of Square after N-th fold
- Find the minimum value of m that satisfies ax + by = m and all values after m also satisfy
- Find if two people ever meet after same number of jumps
- Find the number of consecutive zero at the end after multiplying n numbers
- Find out the correct position of the ball after shuffling
- Find the number after successive division
- Find minimum possible digit sum after adding a number d
- Find the index of the left pointer after possible moves in the array
- Find the modified array after performing k operations of given type
- Find amount of water wasted after filling the tank
- Find the minimum number of rectangles left after inserting one into another
- Find an index such that difference between product of elements before and after it is minimum
- Find the index which is the last to be reduced to zero after performing a given operation
- Find maximum value of the last element after reducing the array with given operations
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.