
Java Code to print Multiplication Table
Hello, In this blog we see the java code to print multiplication table. In this program user give the input and depends on that integer number the multiplication table will displayed.
Program:
import java.util.Scanner;
public class MultiTable1
{
public static void main(String[] args)
{
Scanner s = new Scanner(System.in);
System.out.print(“Enter number:”);
int n=s.nextInt();
for(int i=1; i <= 10; i++)
{
System.out.println(n+” * “+i+” = “+n*i);
}
}
}
In the above code we use variable ‘s’ to store the input value. And by using for loop the actual multiplication table is displayed.
Output:
