Explanatory Question
Analyze the following program segment and determine how many times the loop will be executed and what will be the output of the program segment.
int k = 1;
int i = 2;
while(++i < 6) {
k *= i;
}
System.out.println(k);
Read the answer carefully and go through the related questions on the right side to improve your understanding of this topic.