Trivia - Question?!
Question: Bob has a certain number of apples he wants to give away. He wants to divide out the apples into packets.
If he puts 10 apples per packet then the last packet only contains 9 apples.
Similarly...
If he puts 9 apples per packet then the last packet only contains 8 apples
If he puts 8 apples per packet, then the last packet only contains 7 apples.
If he puts 7 apples per packet, then the last packet only contains 6 apples.
If he puts 6 apples per packet, then the last packet only contains 5 apples.
If he puts 5 apples per packet, then the last packet only contains 4 apples.
If he puts 4 apples per packet, then the last packet only contains 3 apples.
If he puts 3 apples per packet, then the last packet only contains 2 apples.
If he puts 2 apples per packet, then the last packet only contains 1 apples.
How many apples does Bob have?
Answers: Bob has a certain number of apples he wants to give away. He wants to divide out the apples into packets.
If he puts 10 apples per packet then the last packet only contains 9 apples.
Similarly...
If he puts 9 apples per packet then the last packet only contains 8 apples
If he puts 8 apples per packet, then the last packet only contains 7 apples.
If he puts 7 apples per packet, then the last packet only contains 6 apples.
If he puts 6 apples per packet, then the last packet only contains 5 apples.
If he puts 5 apples per packet, then the last packet only contains 4 apples.
If he puts 4 apples per packet, then the last packet only contains 3 apples.
If he puts 3 apples per packet, then the last packet only contains 2 apples.
If he puts 2 apples per packet, then the last packet only contains 1 apples.
How many apples does Bob have?
2519
2519.
ans 9(9).
brk 9(1).
quot 9(9).
rmdr 9(9)
move 1 to ans.
move 0 to brk.
perform until brk = 1
divide 10 into ans giving quot remainder rmdr
if rmdr=9
divide 9 into ans… remainder rmdr
. . .
divide 2 into …remainder rmdr
if rmdr = 1
brk=1
write ans
else
ans=ans+1
end if Report It
* You must be logged into Answers to add comments. Sign in or Register.