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 is polymorphism in oop example?

620


What is object and class in oops?

684


Why is encapsulation used?

659


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

3526


What is an advantage of polymorphism?

703






#include #include #include #include void select(char *items, int count); int main(void) { char s[255]; printf("Enter a string:"); gets(s); select(s, strlen(s)); printf("The sorted string is: %s.\n", s); getch(); return 0; } void select(char *items, int count) { register int a, b, c; int exchange; char t; for(a = 0; a < count-1; ++a) { exchange = 0; c = a; t = items[ a ]; for(b = a + 1; b < count; ++b) { if(items[ b ] < t) { c = b; t = items[ b ]; exchange = 1; } } if(exchange) { items[ c ] = items[ a ]; items[ a ] = t; } } } design an algorithm for Selection Sort

2167


Why is polymorphism needed?

694


How is polymorphism achieved?

664


State what is encapsulation and friend function?

805


Write A Program to find the ambiguities in Multiple Inheritance? How are they resolved.(Virtual Functions)

3659


What language is oop?

673


What is static modifier?

710


What is encapsulation in oops?

633


What is the diamond problem in inheritance?

674


What are the 3 principles of oop?

714