Computer Science, asked by Devanshsrv27, 1 year ago

Output of this program with explanation ! urgent​

Attachments:

Answers

Answered by kalyaniprasad8
1

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


kalyaniprasad8: PLease mark brainliest
Devanshsrv27: sure
Answered by mn121
1

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...

^_^

Similar questions