Convert the while loop in the following code to a do-while loop: Scanner keyboard = new Scanner(System.in);

Question:

Convert the while loop in the following code to a do-while loop: 

Scanner keyboard = new Scanner(System.in);
int x = 1;
while (x > 0)
{
 System.out.print("Enter a number: ");
 x = keyboard.nextInt();
}

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: