Saturday, January 21, 2017

Multiplication Table upto 10 of any Number

Tags

Following is the code to print multiplication table of any number upto 10

import java.util.*;
public class Table
{
    public static void main(String[] args)
    {
        Scanner in=new Scanner(System.in);
        System.out.println("Enter Any Number");
        int a=in.nextInt();
        System.out.println("Multiplication Table");
        for(int i=1;i<=10;i++)
        {
            System.out.printf("%d * %d = %d\n",a,i,a*i);
        }
    }
   
}

Output: