There are 2 empty jars of 5 and 3 liters capacity. And a
river is flowing besides. I want to measure 4 liters of
wanter using these 2 jars. How do you do this?
Answer Posted / harminder
I think i got got bit more simpler solnn with lesser steps
1. Fill 5 ltr jar, pour it intoo 3 ltr till its full
2. Now 3 ltr jar is full n 5 ltr jar has 3 ltrs in it.
3. Empty 3 ltr jar, and pour 2 ltr in 3 ltr jar,, now 4 ltr has 3 ltrs in it and 5 ltr jar is empty
4. Fill 5 ltr jar and out of the 5ltr jar shift water in 3 ltr jar, since only 1 ltr can be tranferred into 3 ltr jar,,
the 5 ltr jar has 4 ltr water in it..
*Hell the interviewer must have seen "Die Hard Part 2 - With a Vengeance" the previous night
| Is This Answer Correct ? | 3 Yes | 9 No |
Post New Answer View All Answers
Why do we use class in oops?
Can abstract class have normal methods?
What do you mean by Encapsulation?
What are the 3 principles of oop?
What is and I oop mean?
#include
What is protected in oop?
Write A Program to find the ambiguities in Multiple Inheritance? How are they resolved.(Virtual Functions)
What is class and object in oops?
Write a java applet that computes and displays the squares of values between 25 and 1 inclusive and displays them in a TextArea box
Why is object oriented programming so hard?
Why interface is used?
c++ program to swap the objects of two different classes
Which type does string inherit from?
Can private class be inherited?