Java Program to print table of any number


In this program, You will learn how to print table of any number in Java.


Table is: 16 32 48 64 80 96 112 128 144 160


Example: How to print table of any number in Java

Run it Now
import java.util.Scanner;

class Main {
    public static void main(String args[]) {

        int i, n;
        Scanner sc = new Scanner(System.in);

        System.out.print("Enter Any Number :");
        n = sc.nextInt();
        System.out.println("\nTable is :");

        for (i = 1; i <= 10; i++) {
            System.out.println(n * i);
        }

    }
}

Output:

Enter Any Number :16
Table is :
16
32
48
64
80
96
112
128
144
160