Skip to content
Advertisement

Trying to output 0 1 2 3 8 5 6 14 8 9 using a for loop in Java [closed]

This is what I have so far:

JavaScript

and it outputs this:

JavaScript

I’m not sure why it’s multiplying the 8 and not the 7 like I want it to do. It’s supposed to output this:

JavaScript

Thanks for any feedback!

Advertisement

Answer

Try it like this.

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement