Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

There is a 100-story building and you are given two eggs.
The eggs (and the building) have an interesting property
that if you throw the egg from a floor number less than X,
it will not break. And it will always brake if the floor
number is equal or greater than X. Assuming that you can
reuse the eggs which didn't broke; you got to find X in a
minimal number of throws. Give an algorithm to find X in
minimal number of throws.

Answer Posted / ashutosh tiwari

Go to the middle floor, 50 in this case; drop egg, if breaks
go to middle of 1st and 50th i.e. 25th floor otherwise go to
middle of 50 and 100 i.e. 75th floor.

Keep on repeating the method to find the floor in minimum
iteration or egg breaking.

Hope this helps..!!!

Is This Answer Correct ?    5 Yes 25 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does double pointer mean in c?

1194


Can we declare variable anywhere in c?

983


Explain the use of 'auto' keyword

1125


how can i write a program that prints out a box such that whenever i press any key8(coordinate number) on the keyboard, the box moves.

1691


What is null in c?

1103


How can you allocate arrays or structures bigger than 64K?

1157


Under what circumstances does a name clash occur?

1215


What is a c token and types of c tokens?

1072


Write a program to generate the Fibinocci Series

1245


Why can arithmetic operations not be performed on void pointers?

1053


What are pointers really good for, anyway?

1072


How can I find the modification date of a file?

1294


Difference between linking and loading?

1120


Is c procedural or functional?

1053


Write a program on swapping (100, 50)

1135