#While loops..

4 messages · Page 1 of 1 (latest)

modern silo
#

Consider the program below.
int number = 20;
int[] values = new int[5];
int position = 0;
while (number > 0) {
values[position] = number % 2;
number = number / 2;
position += 1;
}
List the numbers stored during the while loop into
i. values[0] ,
ii. values[1] ,
iii. values[2] ,
iv. values[3] ,
v. values[4] .

queen knollBOT
#

This post has been reserved for your question.

Hey @modern silo! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

queen knollBOT
#

We won't do your homework for you. Try the problem first, and if you have a question on a specific part of the problem, or your implementation of the problem, we can help!