1. Engineering
  2. Computer Science
  3. could you please explain why the first one is 32...

Question: could you please explain why the first one is 32...

Question details
Could you please explain why the first one is 32 and the second one is 42
1)  Final value is: 32
2)  The answer is: 42

1. For the following program segment, give the output produced by the segment 1int i-0, j-1; 2 while (i < 5) i j2 ii+1 4 System.out.println(Final value is: +j);

2. For the following program segment, give the output produced by the segment: 1 int answer 1 boolean stop-false; 3 while (!stop) 4 answer answer* (answer 1); | if (answer >= 15) { stop = true; } 7 8 System.out.printin(The answer is: +answer)

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution