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 / rp

First of all fill 3litre jar fullyand then pour it into
5litre jar.Now again fill 3litre jar fully and pour it into
5litre jarNow 5litre jar is full and 3litre jar has 1litre
water. Now pour all the water of 5litre jar on the ground
and pour the 3litre's jar 1 litre into 5 litre jar. Now
again fill 3litre jar fully and pour into 5litre jar .Now
5litre jar has 4litre water.
You can simply understand as:-
1)3l jar=3,5l jar=0
2)3l jar=0,5l jar=3
3)3l jar=3,5l jar=3
4)3l jar=1,5l jar=5
5)3l jar=1,5l jar=0
6)3l jar=0,5l jar=1
7)3l jar=3,5l jar=1
8)3l jar=0,5l jar=4

Is This Answer Correct ?    29 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the data types in oop?

608


What is constructor overloading in oop?

607


Plese get me a perfect C++ program for railway/airway reservation with all details.

3429


Which is not an object oriented programming language?

544


What is the real life example of polymorphism?

609






write a program using c++ to implement single contiguous memory mangement techniques.display the content of the main memory after yhe allocation of jobs and percentage of the wastage of the main memory

2763


What is use of overloading?

610


Can we override main method?

607


What is the fundamental idea of oop?

638


why reinterpret cast is considered dangerous?

1903


What is encapsulation process?

582


What is the purpose of enum?

582


What is object in oops?

615


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

1621


How can you overcome the diamond problem in inheritance?

768