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?

Answers were Sorted based on User's Feedback



There are 2 empty jars of 5 and 3 liters capacity. And a river is flowing besides. I want to measu..

Answer / sonia

fill 5 liters jar and pour in 3 liters------ now you have 3 in 3 liters and 2 in 5 liters.
pour away the 3 in 3 liters jar and transfer the 2 in the now empty 3 liters.
Fill 5 liters jar again and pour in 3 liters jar----- Now you have 1 from 5 liters and 2 that were in 3 liters jar already. this gives you 4 in the 5 liters jar.

Is This Answer Correct ?    0 Yes 0 No

There are 2 empty jars of 5 and 3 liters capacity. And a river is flowing besides. I want to measu..

Answer / guest

First fill up the 5 liters jar and start filling 3 liters
jar. so now second jar has 3 liters and first jar has 2
liters. Now again fill 5 liters fully and to complete
second jar 1 liter is needed. So, put water in second jar
from first jar. so, 3 liters jar is full now. And first jar
has 4 liters water.

Is This Answer Correct ?    4 Yes 6 No

Post New Answer

More OOPS Interview Questions

What is encapsulation c#?

0 Answers  


What is destructor oops?

0 Answers  


Precompilation ?

1 Answers   emc2,


What is oops in programming?

0 Answers  


#include <iostream> using namespace std; struct wow { int x; }; int main() { wow a; wow *b; a.x = 22; b = &a; a.x = 23; cout << b->x; return 0; }

1 Answers  






Can we define a class within the interface?

0 Answers  


what is cast operator?

2 Answers   Microsoft,


What is use of overloading?

0 Answers  


What is the point of polymorphism?

0 Answers  


#include <stdio.h> #include <alloc.h> #include <stdlib.h> #include <conio.h> void insert(struct btreenode **, int); void inorder(struct btreenode *); struct btreenode { struct btreenode *leftchild; struct btreenode *rightchild; int data; }; main() { struct btreenode *bt; bt=(struct btreenode *)NULL; int req,i=1,num; clrscr(); printf("Enter number of nodes"); scanf("%d",&req); while(i<=req) { printf("Enter element"); scanf("%d",&num); insert(&bt,num); i++; } inorder(bt); } void insert(struct btreenode **sr, int num) { if(*sr==NULL) { *sr=(struct btreenode *)malloc (sizeof(struct btreenode)); (*sr)->leftchild=(struct btreenode *)NULL; (*sr)->rightchild=(struct btreenode *)NULL; (*sr)->data=num; return; } else { if(num < (*sr)->data) insert(&(*sr)->leftchild,num); else insert(&(*sr)->rightchild,num); } return; } void inorder(struct btreenode *sr) { if(sr!=(struct btreenode *)NULL) { inorder(sr->leftchild); printf("\n %d",sr->data); inorder(sr->rightchild); } else return; } please Modify the given program and add two methods for post order and pre order traversals.

0 Answers  


3. Differentiate verification and validation.

1 Answers  


i am getting an of the type can not convert int to int *. to overcome this problem what we should do?

0 Answers  


Categories