Output of this program with explanation ! urgent
Answers
Initial value of p=200
After every iteration, value of p decreases by 10.
And if p is a multiple of 20, that iteration is not conducted (due to the continue statement)
Hence there are only 3 iterations(1.p=190;2.p=170;3.p=150)
Output:
190
170
150
this loop will execute 6 times...
explanation :
first time,
p = 200
(p>=150) is true
second time,
p = 190
(p>=150) is true
third time,
p = 180
(p>=150) is true
fourth time,
p = 170
(p>=150) is true
fifth time,
p = 160
(p>=150) is true
sixth time,
p = 150
(p>=150) is true
seventh time,
p = 140
(p>=150) is false
so, by this we can understand that the given condition is true six times...
output :
190
170
150
explanation :
the output does not include 200 , 180 and 160 because they are divisible by 20 and so, the condition (p%20==0) becomes true and due to the function ' continue; ' System.out.println(p); is skipped....
.
Hope it helps you...
please mark it as brainliest...
^_^