subject

Here is a while loop that counts from 1 to 5 that demonstrates the 3 steps of writing a loop. Can you change it to count from 2 to 10? Can you make it count by 2s? Can you make it count backwards?

public class LoopTest1

{

public static void main(String[] args)

{

// 1. initialize the loop variable

int count = 1;



// 2. test the loop variable

while (count <= 5)

{
11
System. out. println(count);

// 3. change the loop variable

count++;

}

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 18:00
Budgets you to do all of the following expect a) send frivolously b) avoid over spending c) gain financial independence d) examine your priorities and goals
Answers: 2
question
Computers and Technology, 25.06.2019 05:30
Two technicians are discussing a resistance measurement. technician a states that components being measured should be removed or isolated from the circuit. technician b states that power to the circuit should be disconnected when measuring resistance. which technician is correct?
Answers: 1
question
Computers and Technology, 25.06.2019 05:40
How to make a negative number positive in excel
Answers: 3
question
Computers and Technology, 25.06.2019 06:00
In 2 to 3 sentences, describe how you would change the background of a group of cells
Answers: 1
You know the right answer?
Here is a while loop that counts from 1 to 5 that demonstrates the 3 steps of writing a loop. Can yo...
Questions
question
Health, 02.10.2019 01:00
Questions on the website: 13722362