Whenever some number is incremented or decremented on that same instant..
Rather if you use the value of i for the next step....you will get the expected result...
If not clear then you may DM me
1. No, maybe you type it wrong..
There is unknown character in your syntax that java not usually use it
What is it? Your minus.. (-)
Use the short minus.. (-)
Not the long one(—) neither the med one..(–)
Done.. Your syntax, bug, and error fixed..
Always try to read your own error in console, because it sometimes tell you which line or syntax is wrong..