Computer Applications
Give the output of the following program segment and also mention the number of times the loop is executed:
int x, y;
for (x = 9, y = 4; x <= 45; x+=9) {
if (x % y == 0)
break;
}
System.out.println(x);
Related Questions
Give the output of the following program segment. How many times is the loop executed?
for(x=10; x>20;x++) System.out.println(x); System.out.println(x*2);How many times will the following loop execute? Write the output of the code:
int x=10; while (true){ System.out.println(x++ * 2); if(x%3==0) break; }