Ask your own question, for FREE!
MIT 6.001 Structure and Interpretation of Computer Programs, Spring 2005 12 Online
OpenStudy (haleyelizabeth2017):

Java programming- Suppose b is a boolean variable with an unknown value. Which of the following loop statements would you choose if you wanted to guarantee that the body of the loop gets executed at least once? while (b) {System.out.print('x');} do {System.out.print('x'); } while (b) for (int j=0; b; j++) {System.out.print('x');} while (b!) {System.out.print('x'); }

OpenStudy (haleyelizabeth2017):

I think it would be B...right?

jaynator495 (jaynator495):

Correct

OpenStudy (haleyelizabeth2017):

Thank you very much :)

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!