river crossing priests and devils in c program
-
Solution:
To arrive all the priests and devils to the other side, 6 steps are to be followed:--
Firstly one devil and one priest will go to the other side. Devil will stay to the other side while priest will come back with the boat.
-
Remaining two devils will go to the other side.
One devil will stay to the other side while one devil will come again with the boat.
So total two devils are on the another side of river and 3 priests and 1 devil is on the one side of the river. -
Now two priests will go. One priest will stay while 1 priest and 1 devil come back with the boat.
-
Now remaining two priests will go to the other side of the river.
Total 3 priests and 1 devil is on the one side while 2 devils is on the another side of the river.
1 devil will come back with the boat. -
2 devils will go to the other side of the river. 1 devil will stay and 1 devil will again go back with the boat.
-
Now the remaining 2 devils will come to the other side of the river.
All the 3 priests and 3 devils arrive safely.
kindly help this project
-
-
Solution:
To arrive all the priests and devils to the other side, 6 steps are to be followed:--
Firstly one devil and one priest will go to the other side. Devil will stay to the other side while priest will come back with the boat.
-
Remaining two devils will go to the other side.
One devil will stay to the other side while one devil will come again with the boat.
So total two devils are on the another side of river and 3 priests and 1 devil is on the one side of the river. -
Now two priests will go. One priest will stay while 1 priest and 1 devil come back with the boat.
-
Now remaining two priests will go to the other side of the river.
Total 3 priests and 1 devil is on the one side while 2 devils is on the another side of the river.
1 devil will come back with the boat. -
2 devils will go to the other side of the river. 1 devil will stay and 1 devil will again go back with the boat.
-
Now the remaining 2 devils will come to the other side of the river.
All the 3 priests and 3 devils arrive safely.
kindly help this project
-
-
Solution:
To arrive all the priests and devils to the other side, 6 steps are to be followed:--
Firstly one devil and one priest will go to the other side. Devil will stay to the other side while priest will come back with the boat.
-
Remaining two devils will go to the other side.
One devil will stay to the other side while one devil will come again with the boat.
So total two devils are on the another side of river and 3 priests and 1 devil is on the one side of the river. -
Now two priests will go. One priest will stay while 1 priest and 1 devil come back with the boat.
-
Now remaining two priests will go to the other side of the river.
Total 3 priests and 1 devil is on the one side while 2 devils is on the another side of the river.
1 devil will come back with the boat. -
2 devils will go to the other side of the river. 1 devil will stay and 1 devil will again go back with the boat.
-
Now the remaining 2 devils will come to the other side of the river.
All the 3 priests and 3 devils arrive safely.
kindly help this project
At the top of this forum is a topic "How to ask a question", please read and pay particular attention to #2.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment "Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst "I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
-
-
Solution:
To arrive all the priests and devils to the other side, 6 steps are to be followed:--
Firstly one devil and one priest will go to the other side. Devil will stay to the other side while priest will come back with the boat.
-
Remaining two devils will go to the other side.
One devil will stay to the other side while one devil will come again with the boat.
So total two devils are on the another side of river and 3 priests and 1 devil is on the one side of the river. -
Now two priests will go. One priest will stay while 1 priest and 1 devil come back with the boat.
-
Now remaining two priests will go to the other side of the river.
Total 3 priests and 1 devil is on the one side while 2 devils is on the another side of the river.
1 devil will come back with the boat. -
2 devils will go to the other side of the river. 1 devil will stay and 1 devil will again go back with the boat.
-
Now the remaining 2 devils will come to the other side of the river.
All the 3 priests and 3 devils arrive safely.
kindly help this project
Member 13655542 wrote:
kindly help this project
Help or Do? If the former, what have you done (for us to help you with)?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
-