Either way, I think you're trying to do too much inside the loop statement. Think about how you might use other variables instead of trying to do everything with a single variable i.
Type: Posts; User: KevinWorkman
Either way, I think you're trying to do too much inside the loop statement. Think about how you might use other variables instead of trying to do everything with a single variable i.
If i is equal to the grains of rice, and you're multiplying the grains of rice by 2 each time, what is the significance of adding 1 to i each time?
Well, the only number you're incrementing is i. What does that represent? In the stuff you wrote out, where is the equivalent of i?
You should post your code in the form of an SSCCE so we can see what's really going on. Don't forget the highlight tags.
But you're going to have to think about how you solved it in the first...