Question

Consider the following Loop: int x = 120; while(x % 3 != 0) { System.out.println(x *...

Consider the following Loop: int x = 120; while(x % 3 != 0) { System.out.println(x * 4); } System.out.println("x is "+x); SELECT THE CORRECT NUMBER OF ITERATIONS AND THE CORRECT OUTPUT.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer: x is 120

There will bot only 0 iterations. because while condition will return false when x value is 120.

x % 120 will give 0 value.

x % 120 != 0 will return false.

Add a comment
Know the answer?
Add Answer to:
Consider the following Loop: int x = 120; while(x % 3 != 0) { System.out.println(x *...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT