J
J
Java Developer2021-03-14 10:05:20
Java
Java Developer, 2021-03-14 10:05:20

Problems with the (for) loop. How does this happen?

604db7b5ed727659477617.jpeg

Please explain the sequence of this process.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Roo, 2021-03-14
@Elxanjv_1

x = 0; y = 0
x = 1; y = 0;                              *
x = 2; y = 0; y = 1;                     *  *
x = 3; y = 0; y = 1; y = 2;            *  *  *
x = 4; y = 0; y = 1; y = 2;  y = 3;  *  *  *  *

*corrected

B
BorLaze, 2021-03-14
@BorLaze

You would also write by hand ... You take
your code, run it under a debugger, follow it step by step and watch how the values ​​of the variables change and what is displayed on the screen.
And everything will be clear.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question