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 are N egg baskets and the number of eggs in each
basket is a known quantity. Two players take turns to remove
these eggs from the baskets. On each turn, a player must
remove at least one egg, and may remove any number of eggs
provided they all belong to the same basket. The player
picking the last egg(s) wins the game. If you are allowed to
decide who is going to start first, what mathematical
function would you use to decide so that you end up on the
winning side?

Upload a C program to demonstrate the behaviour of the game.

Answer Posted / venu

condition: First person should win
The logic is:
1.if n== odd
First person will remove all eggs from the basket.
next until empty baskets ==1, First person will just do
what ever the second person do. Once last basket comes he
will remove all eggs.
2.if n== even
First person will take out all eggs except one, 2nd
person forced to loose 1 chance as he will remove that egg.
Now next step is just do the (1)

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is gets() function?

1080


What is the meaning of c in c language?

1084


HOW TO SOLVE A NUMERICAL OF LRU IN OS ??????

2642


Iam a B.Tech graduate and completed my engineering in 2009, from 2005 to 2009 and after that i had done nothing.Now i want to do job and get into BPO field . Friends give me suggestions as what to say in interview... if they ask me that what would you had done ... these many years without doing job ??????? pls urgent

1778


How can a number be converted to a string?

1247


In c programming, explain how do you insert quote characters (? And ?) Into the output screen?

1203


What does c value mean?

1118


What is fflush() function?

1085


The % symbol has a special use in a printf statement. Explain how would you place this character as part of the output on the screen?

1146


write a programe to accept any two number and check the following condition using goto state ment.if a>b,print a & find whether it is even or odd and then print.and a

1888


Why is python slower than c?

1031


Is exit(status) truly equivalent to returning the same status from main?

1012


What is the purpose of ftell?

1038


What is the purpose of sprintf() function?

1056


Explain the difference between call by value and call by reference in c language?

1059