Computer Science, asked by duggumeetclass, 6 months ago

Analyse the following program segment and determine how many times the loop will be executed and what will be the output of the program segment.

int p=300
while(true)
{
if(p<100)
break;
p=p-20;
}
System.out.println(p);​

Answers

Answered by ROCKYCEO
4

Answer:

Explanation:

The Loop Will Be Executed For 6 Times.....As The Final Value of p will Be 80 which Is Less than 100.....then It counter the Break Statement And Left the loop....

Similar questions