Analyze the following program segment and determine how many times the loop will be executed. What will be the output of the program segment?
Advertisements
Question
Analyze the following program segment and determine how many times the loop will be executed. What will be the output of the program segment?
int k = 1, i = 2;
while (++i < 6)
k *= i;
System.out.println(k);Answer in Brief
One Line Answer
Advertisements
Solution
3 times = 60
shaalaa.com
Is there an error in this question or solution?
