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
What are objects in oop?
How many human genes are polymorphic?
Get me an image implementation program.
What do you mean by overloading?
What is encapsulation with example?
Why can't we have instance(stack) of a class as a member of the same class like eg.Class A{A obj;} as we can have self refential pointer
What is the use of oops?
What are the advantages of polymorphism?
write a programe to calculate the simple intrest and compund intrest using by function overlading
What are two types of polymorphism?
What is the difference between inheritance and polymorphism?
hi all..i want to know oops concepts clearly can any1 explain??
What is the difference between a constructor and a destructor?
How can you overcome the diamond problem in inheritance?
What are the benefits of oop?