Java program to display multiplication table.

Below code is to display multiplication table using Java:

import java.util.Scanner;

class Mult
{
    public static void main(String arg[])
    {
        int n,c;
        System.out.print("Enter the integer to print its table");
        Scanner in = new Scanner(System.in); 
        n=in.nextInt();
        System.out.println("Multiplication table of "+n+"is :");
        for(c=1;c<11;c++)
        System.out.println(n+"*"+c+"="+(n*c));
    }
}
Thank You.

© Copyright - 2018 - 2021 | All rights reserved at Funda of Web IT