0
In kotlin how to decrement value by 2 in for loop?
I know how to decrement value by 1 in kotlin in for loop but i am confused with decrement by 2
3 Answers
+ 4
i -= 2;
or
i = i -2;
+ 3
https://code.sololearn.com/cr2Nqb3aIKRu/?ref=app
Analyze this code, downTo is used for back ranges and step tell how much step you want to go back! It's simple English, haha!
All the best!
+ 2
i+=-2;
Including JaScript dont think theres anymore ways