Computer Science, asked by jayasinghkishan, 1 year ago

can anyone help me to solve this java program?​

Attachments:

Answers

Answered by mn121
2

when m = 5,

loop runs 1 time

if(m%3==0) is false

if(m%5==0) is true

so, m will be printed

output: 5

when m = 10,

loop runs 2 times

if(m%3==0) is false

if(m%5==0) is true

so, m will be printed in next line

output: 10

when m = 15,

loop runs 3 times

if(m%3==0) is true

so, the program terminates...

(i) 5

   10

(ii) the loop runs 3 times


jayasinghkishan: thank you but the loop is 5 times not 3 times
jayasinghkishan: sorry you are correct i was seening the wrong answer. sorry
Similar questions