Question: Ready for Takeoff! This code sample has a do while loop that prints the count from num down to 1 . Although the code compiles
Ready for Takeoff!
This code sample has a do while loop that prints the count from num down to Although the code compiles and runs, it does not return the expected result.
Identify the bug and fix it
If the value of num is then this is what the result should be:
The count is: The count is: The count is: The count is: The count is:
import java.io;
import java.util.;
import java.text.;
import java.math.;
import java.util.regex.;
public class findTheBug
public static void mainString args
Scanner in new ScannerSystemin;
int num innextInt;
FIX THE CODE BELOW THIS LINE
int count ;
do
System.out.printlnThe count is: count;
count;
while count num;
STDOUT
Expected STDOUT
Thecountis:
Thecountis:
Thecountis:
Thecountis:
Thecountis:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
