4-4 MultiplicationTable

posted Feb 8, 2014, 6:41 AM by Dlovan ismail   [ updated Feb 8, 2014, 6:41 AM by Karwan Jacksi ]
//Write a program to display the multiplication table of a given number?

package multiplicationtable;
import java.util.Scanner;

public class MultiplicationTable
{
    public static void main(String[] args) 
    {
            System.out.println("Welcome to the multiplication table program");
            System.out.print("Enter a number to generate a multiplication table: ");

            // Create a Scanner object for keyboard input.
            Scanner input = new Scanner(System.in);

            //For storing the entered value.
             int number = input.nextInt();
             int i=1;

             do
             {
                  System.out.println(i + " * " + number + " = " + (i*number));
                  i++;    

             }while(i<=10);

    }   
}

ċ
MultiplicationTable.java
(1k)
Karwan Jacksi,
Feb 8, 2014, 6:41 AM
Comments