InterviewSolution
Saved Bookmarks
| 1. |
Analyze the following program segment and determine how many times the body of loop will be executed (show the working). x=5; y=50; while (x<=y) { y=y/x; System.out.println(y); } |
||||||||||||||||
|
Answer» Working of a loop.
Thus with the above table, it is clear that the loop will executed times and produces the output 10 and 2 respectively. On the third time it becomes false and the iteration stops. |
|||||||||||||||||