Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • if that's correct then why series doesn't start with 0? Commented Mar 18, 2015 at 19:52
  • @user2015669: Because by the time you use it in your println, it's already been incremented. The operator is in the for condition, so the for condition uses the old value. Then the body of the for is executed with a having the new value. Commented Mar 18, 2015 at 19:53
  • When the condition is being checked in the for part, a=0. But after it was checked, it was incremented to a=1. So it will print 1 and not 0. Commented Mar 18, 2015 at 19:54
  • Thanks a lot for clearing up my concepts! Commented Mar 18, 2015 at 19:58