Assignment #110 Displaying Some Multiples
Code
Name: Iaroslav Titov
Period: 7
Project Name: Multiples
File Name: Multiples.java
Date: 1/12/2015
import java.util.Scanner;
import java.util.InputMismatchException;
public class Multiples
{
public static void main( String[] args )
{
Scanner keyboard = new Scanner(System.in);
int num = 0;
try
{
System.out.print("Choose a number: ");
num = keyboard.nextInt();
System.out.println("");
}
catch (InputMismatchException e)
{
System.out.println("WRONG INPUT");
}
for (int i = 1; i < 13; i++ )
System.out.println(num+"x"+i+" = "+ (num*i));
}
}
Picture of the output