[Solved] can anyone explain what is going on in this program

[ad_1]

In your first program, you do i++ twice, and m++ once. So at the end of the first iteration, the values of i and m are equal (which is 2) – so in the next iteration i < m condition fails, and the loop exits.

In the second case, you set the value of m (the stop condition) to 5, and the loop executes until the (m<5) stop condition is met.

Note that it is generally a bad practice to change the value of the stop condition inside the loop, as it leads to confusion such as this.

[ad_2]

solved can anyone explain what is going on in this program