For loop to While loop Java
<?php
int[] numbers = {10, 20, 30, 40, 50};
int i = 0;
while (i < numbers.length) {
int currentValue = numbers[i];
if (currentValue == 30) {
break;
}
System.out.println(currentValue);
i++;
}
0 comments:
Post a Comment
Thanks