Perform automated and live-interactive testing on 3000+ real desktop and mobile devices online.
To print the Multiplication table, enter any integer as input. Now use for loop from 1 to 10 to generate the Multiplication of that integer.
Following is the Java program that prints the Multiplication table of a number.
import java.util.Scanner;
public class MultiplicationTable {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print("Enter any number:");
int num = sc.nextInt();
for (int i = 1; i <= 10; i++) {
System.out.println(num + " * " + i + " = " + num * i);
}
}
}
Output
Enter number: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
Test orchestration and execution cloud of 3000+ browsers and OS
24/7 support
Enterprise grade security
Fastest test execution cloud