Advertisements
Advertisements
प्रश्न
Analyze the following program segment and determine how many times the body of the loop will be executed (show the working).
x = 5; y = 50;
while (x <= y)
{
y = y / x;
System.out.println(y);
}
थोडक्यात उत्तर
उत्तर
`50/5 = 10`
`10/5 = 2`
The loop is executed twice.
shaalaa.com
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 1.09: Iterative Constructs in Java - EXERCISES [पृष्ठ १२२]