Consider the following two code segments: Segment 1: while (k > 0) { System.out.println(k); k--; } --------------- Segment 2: while (k > 0) { System.out.println(k); k--; } while (k > 0) { System.out.println(k); k--; } Assume that in both cases variable k has the same initial value. Under which of the following conditions will the two code segments produce identical output.

Relax

Respuesta :

Answer:

Always same value

Explanation:

These both code segments will always generate identical values given that we provide same value of k to both segments.

You can see attached pictures.

Ver imagen dayanandghelaro
Ver imagen dayanandghelaro
Ver imagen dayanandghelaro