If you build a straight fence one hundred feet long, using ten-foot-long rails, how many fenceposts do you need?
The obvious answer is 100/10=10, which is wrong. The correct answer is eleven.
If you write a computer program to process items I through J of a list, how many items will be processed?
The obvious answer is J-I items, which is wrong. The correct answer is J-I+1.
No comments:
Post a Comment