/* * Autor: Juan Antonio Ripoll * Date: 30/10/13 * * 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"). * */ import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); System.out.print("Enter a number: "); int number = in.nextInt(); while (number != 0) { System.out.println(number*10); System.out.print("Enter a number: "); number = in.nextInt(); } } }
Wednesday, October 30, 2013
2.06 - Repeat until 0
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment