We have a scale and 7 balls. 1 ball is heavier than all the
rest. How to determine the heaviest ball with only 3
possible weighing attempts?

Answer Posted / srini

let a,b,c,d,e,f,g be the 7 balls,
group them
a and b group 1
b and c group 2 and others one group
weigh group 1 against group 2
if they are not equal weigh the individual balls with
respect to each other

if they are not equal(group 1 is not equal to group 2)
weigh e against f, if they are not equal heaviest among
them is ur answer else g is the answer.

Is This Answer Correct ?    6 Yes 22 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is difference between class template and template class?

2161


What does and I oop mean in text?

627


How to handle exception in c++, For example in a functions i am assigning memory to some variables and also in next instructions in am dividing one variable also. If this functions generates a error while allocating memory to those variable and also while dividing the variable if i divide by zero then catch block how it will identify that this error has cone from perticular instruction

1658


What is the difference between inheritance and polymorphism?

594


What is inheritance in oop?

606






What is a superclass in oop?

673


What is polymorphism in oop example?

519


write a code for this:trailer recordId contains a value other than 99, then the file must error with the reason ‘Invalid RECORD_ID’(User Defined Exception).

1647


write a program to enter a string like"sunil is a good boy and seeking for a job" not more than 10 characters including space in one line,rest characters should b in other line.if the next line starts from in between the previous word,then print whole word to next line.

1795


What is byval and byref? What are differences between them?

1693


What is stream in oop?

843


Why do we use encapsulation in oops?

529


write a code for this. serial_number contained in the header of the file will be read , if this serial number is less than a previous serial number within a successfully processed file, or is the same as another serial number within a successfully processed file, or if the field contains anything other than 7 digits, then the file must error with the reason ‘Invalid SERIAL_NUMBER’.

1784


What is polymorphism and its types?

601


What is class encapsulation?

606