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 / the practitioner

Just start on the first floor and throw the egg. If it
breaks then X=1
If not then go to the second floor and throw the egg. If it
breaks then X=2
If not then go to the third floor and throw the egg. If it
breaks then X=3
If not then keep doing that and the floor it breaks on is
the floor that X equals.
But really, in real life, a real egg would break from 3
feet.

Is This Answer Correct ?    0 Yes 31 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Difference between macros and inline functions? Can a function be forced as inline?

1198


Explain what is a stream?

1029


What is the use of clrscr?

1047


What are the rules for the identifier?

1113


Can a pointer be static?

1016


Explain the use of bit fieild.

1096


What is the scope of static variable in c?

943


What does calloc stand for?

1081


When should you use a type cast?

1053


What are the preprocessor categories?

999


What are the __date__ and __time__ preprocessor commands?

1033


Why & is used in scanf in c?

1047


What is the use of a semicolon (;) at the end of every program statement?

1410


‘SAVEPOINT’ and ‘ROLLBACK’ is used in oracle database to secure the data comment. Give suitable examples of each with sql command.

2293


Define C in your own Language.

1032