4-4 MultiplicationTable

Post date: Feb 8, 2014 2:41:26 PM

//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);

    }   

}