anyone computer expert here then please solve this
Attachments:
Answers
Answered by
1
a) it will run only 5 times because after after 5th loop p become 100 and condition (p< 100) will fail and will come out from loop and output will b 100
b) i) k = 6 j =10
ii) a= 16.0
c) int d = 5;
for (int i = 1; i <= 5; i ++){
d = d * 2;
System.out.println(d);
}
b) i) k = 6 j =10
ii) a= 16.0
c) int d = 5;
for (int i = 1; i <= 5; i ++){
d = d * 2;
System.out.println(d);
}
Answered by
1
Hey buddy first analyze the loop,here it is while loop and it's argument is true.So loop is always iterating.But until p=100 the break statement will stop execution of the loop and come out of loop.But whenever value of p will become greater than 100 the p=p+20 will come into execution and the resulting solution will become 180.
Similar questions