Given a tank with definite height and radius and the flow of water available to fill the tank. Determine whether the tank will overflow or not in a given amount of time.
Note: The flow of water will be available in volume per minute.
--r=5-- ---------- ^ | | | | | | | | h = 10 | | | ---------- ^ rate_of_flow = 10 Input : given_time = 10.0 Output : Underflow Input : given_time = 100.0 Output : Overflow
Volume of a cylindrical tank is (22/7) * radius * radius * height. First, find out the amount of time required to completely fill the tank then compare it with the given time. If the given time is greater than required time, it will result in an overflow condition. If the given time is less than the required time then it will result in an underflow condition otherwise the tank is filled.
Below is the implementation of 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
- Program to check if water tank overflows when n solid balls are dipped in the water tank
- Check for integer overflow on multiplication
- Program to find the time after K minutes from given time
- Find amount of water wasted after filling the tank
- Check if it is possible to make x and y zero at same time with given operation
- Check for balanced parentheses in an expression | O(1) space | O(N^2) time complexity
- How to avoid overflow in modular multiplication?
- Compute average of two numbers without overflow
- Reverse digits of an integer with overflow handled
- Program to find the time remaining for the day to complete
- Time difference between expected time and given time
- Sum of elements in range L-R where first half and second half is filled with odd and even numbers
- Python program to convert time from 12 hour to 24 hour format
- Changing One Clock Time to Other Time in Minimum Number of Operations
- Program to check if two strings are same or not
Improved By : jit_t