Question: double num; int incr = 0 ; Scanner reader = new Scanner ( System . in ) ; do { incr = incr + 1

double num;
int incr =0;
Scanner reader = new Scanner(System.in);
do
{
incr = incr +1;
System.out.println("Please enter a number (0 when done): ");
num = reader.nextDouble();
}
while (num !=0);
System.out.println(""+ incr);
Question 27 options:
The execution of the loop is independent of user input.
The program prints the count of positive inputs.
The loop will execute only when 0 is entered.
The loop will execute at least once even if the user has entered the sentinel value.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!