Yes.
First iteration: i = 1, 1/1 = 1 > 0, so it loops.
Second iteration: i = 2, 1/2 = 0 !> 0 (integer division), so it stops.
10
solved Does this ‘for’ loop stop, and why/why not? for (int i=1; 1/i > 0; i++) { }
Yes.
First iteration: i = 1, 1/1 = 1 > 0, so it loops.
Second iteration: i = 2, 1/2 = 0 !> 0 (integer division), so it stops.
10
solved Does this ‘for’ loop stop, and why/why not? for (int i=1; 1/i > 0; i++) { }