Exercise
Repeat Until 0
Objetive
Create a java program to ask the user for a number "x" and display 10*x. It must repeat until the user enters 0 (using "while").
Example Code
import java.util.*;
public class Main
{
public static void main()
{
int number;
System.out.print("Enter a number: ");
number = Integer.parseInt(new Scanner(System.in).nextLine());
while (number != 0)
{
System.out.println(number * 10);
System.out.print("Enter a number: ");
number = Integer.parseInt(new Scanner(System.in).nextLine());
}
}
}