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; }
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.
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.
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.
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.
Im sorry I get only half of what you're saying. @adozenbabydogs
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
one times two is two, time two is four, times two is eight, times two is sixteen.
one times two is two, time two is four, times two is eight, times two is sixteen.
Im sorry I get only half of what you're saying. @adozenbabydogs
OK I see it's glitching I'm using my phone
Okay.
So, what don't you understand?
Now I get it! So there are no odd numbers involved to get the value of 16. Thanks!
Welcome.
@adozenbabydogs I got it now I'm just not properly getting the posts because I'm on my phone
Okay.
Join our real-time social learning platform and learn together with your friends!