Question: Consider the code below. Which of the lines of code can replace the code block to result in 2 being printed for count? int

Consider the code below. Which of the lines of code can replace the code block to result in 2 being printed for count?

 

int count = 20;

** code block **
{
  count /= 2;

}
System.out.println(count);

 

A while (count == 5)

B while (count < 5)

C while (count > 5)

D while (count <= 5)

E while (count >= 5)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

10 The correct Option is OOptionE Explanation We should loop till the value is greate... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!