0
How is that âforâ logic works on Java?
I was playing some challenge on Java and that code below appeared to me. I canât understand how that output is 200, if someone can put the step by step to help me Iâll be grateful https://code.sololearn.com/c3er7y735ve0/?ref=app
2 Answers
+ 3
The outer for runs 10 times it subtract 10 from x resulting in subtract 100 from x.
The inner for runs 3 * 10 = 30 times it add 10 to x resulting in adding 300 to x
so x = 300-100=200
+ 1
Thank you, Osama!! It helped me a lot!