C Exercise Example101
# Monkey Eating Peaches Problem
[ C Classic 100 Examples](#)
A little monkey picked many peaches one day. On the first day, it ate half of them, and then couldn't help but ate one more. On the second day, it again ate half of the remaining peaches plus one. This pattern continued every day. On the 10th day, the little monkey found there was only one peach left. How many peaches did the little monkey pick on the first day?
## Example
#includeint main(){int i = 1; int j = 1; for(j = 10; j>1;j --){i++; i = 2 * i; }printf("Picked %d peaches on the first day.", i); }
The output of the above example is:
Picked 1534 peaches on the first day.
[ C Classic 100 Examples](#)
YouTip