Write a java program to print multiplication table using for loop

Write a java program to print multiplication table using for loop. In the Java application, print the mathematics tables. As a novice in the Java programming language, this software is even more impressive and expands the programming ideas. The method of obtaining a product by combining matrices, vectors, or other quantities according to particular laws.

import java.util.Scanner;
public class Main
{
public static void main(String args[])
{
int number, i, tab;
Scanner scan = new Scanner(System.in);
System.out.print("Enter a numbers");
number = scan.nextInt();
System.out.print("Table of " + number + " is\n");
for(i=1; i<=5; i++)
{
tab = number*i;
System.out.print(number + " * " + i + " = " + tab + "\n");
}
}
}

Output:

Enter a numbers2
Table of 2 is
2 * 1 = 2
2 * 2 = 4
2 * 3 = 6
2 * 4 = 8
2 * 5 = 10