Ask your own question, for FREE!
Computer Science 7 Online
OpenStudy (anonymous):

I know the value of j is 16 but I don't know why it is int i = 1; int j = 1; while (i < 5){ i++; j = j * 2; }

OpenStudy (adozenbabydogs):

J starts as one. While i is less than five, one is added to five, and j is multiplied by two. The while statement will loop itself until the condition is met. So until I equals five, the while will run, and the value of J will constantly be multiplied by two.

OpenStudy (adozenbabydogs):

J starts as one. While i is less than five, one is added to five, and j is multiplied by two. The while statement will loop itself until the condition is met. So until I equals five, the while will run, and the value of J will constantly be multiplied by two.

OpenStudy (adozenbabydogs):

J starts as one. While i is less than five, one is added to five, and j is multiplied by two. The while statement will loop itself until the condition is met. So until I equals five, the while will run, and the value of J will constantly be multiplied by two.

OpenStudy (adozenbabydogs):

I glitched Open Study, going back to the previous page will duplicate your response if you've already sent it. I don't know if I'm the only one who sees three of what I said, but it's there.

OpenStudy (anonymous):

Im sorry I get only half of what you're saying. @adozenbabydogs

OpenStudy (anonymous):

I understand I is 1 and j is 1 and that I will not take any more values than 5 since its less than 5 but the j is 1 that's all I understand about j

OpenStudy (adozenbabydogs):

one times two is two, time two is four, times two is eight, times two is sixteen.

OpenStudy (adozenbabydogs):

one times two is two, time two is four, times two is eight, times two is sixteen.

OpenStudy (anonymous):

Im sorry I get only half of what you're saying. @adozenbabydogs

OpenStudy (anonymous):

OK I see it's glitching I'm using my phone

OpenStudy (adozenbabydogs):

Okay.

OpenStudy (adozenbabydogs):

So, what don't you understand?

OpenStudy (anonymous):

Now I get it! So there are no odd numbers involved to get the value of 16. Thanks!

OpenStudy (adozenbabydogs):

Welcome.

OpenStudy (anonymous):

@adozenbabydogs I got it now I'm just not properly getting the posts because I'm on my phone

OpenStudy (adozenbabydogs):

Okay.

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!