Java Program To Print Multiplication Table In Range

01. Example:

import java.util.Scanner;

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

        int number01, number02, i, j;

        System.out.println("Enter Range Of Numbers To Print Their Multiplication Table: ");
        Scanner input = new Scanner(System.in);
        number01 = input.nextInt();
        number02 = input.nextInt();

        for (i = number01; i <= number02; i++) {
            System.out.println("nMultiplication Table Of " + i);
            for (j = 1; j <= 10; j++) {
                System.out.println(i + "*" + j + " = " + (i * j));
            }
        }

    }
}

Output:

Enter Range Of Numbers To Print Their Multiplication Table: 3 6


Multiplication Table Of 3
3*1 = 3
3*2 = 6
3*3 = 9
3*4 = 12
3*5 = 15
3*6 = 18
3*7 = 21
3*8 = 24
3*9 = 27
3*10 = 30

Multiplication Table Of 4
4*1 = 4
4*2 = 8
4*3 = 12
4*4 = 16
4*5 = 20
4*6 = 24
4*7 = 28
4*8 = 32
4*9 = 36
4*10 = 40

Multiplication Table Of 5
5*1 = 5
5*2 = 10
5*3 = 15
5*4 = 20
5*5 = 25
5*6 = 30
5*7 = 35
5*8 = 40
5*9 = 45
5*10 = 50

Multiplication Table Of 6
6*1 = 6
6*2 = 12
6*3 = 18
6*4 = 24
6*5 = 30
6*6 = 36
6*7 = 42
6*8 = 48
6*9 = 54
6*10 = 60

Leave a comment