Java Program To Print Multiplication Table

01. Example:

import java.util.Scanner;

class multiplicationTable {
    public static void main(String args[]) {
        
        int number, counter;
        
        System.out.print("Enter An Integer To Print Table: ");
        Scanner input = new Scanner(System.in); 
        number = input.nextInt(); 
        System.out.println("Multiplication Table Of " + number + " Is :");
            
            for (counter = 1; counter <= 10; counter++)
                System.out.println(number + "*" + counter + "  = " + (number * counter));
        }
    }

Output:

Enter An Integer To Print Table: 5
Multiplication Table Of 5 Is :
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

Leave a comment