N
N
Nikita Salnikov2020-04-20 13:26:48
C++ / C#
Nikita Salnikov, 2020-04-20 13:26:48

How many times are the loops executed?

5e9d78513fae7114183756.jpeg
Hello. Please tell me why from this figure in the first example the cycle is executed 1 time, in the third example 7 times, in the fifth 8 times. Can someone explain in simple terms. that he could not understand.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Pavlov, 2020-04-20
@Stalker31

In the first example, count is multiplied by a negative number -1 and exits the while as it becomes negative.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question