Q.
Write a java program to generate multiplication table of 14
Here is a simple Java program that generates the multiplication table for the number 14:
public class MultiplicationTable {
public static void main(String[] args) {
int number = 14; // Number for which the multiplication table will be generated
// Loop to generate multiplication table from 1 to 10
for (int i = 1; i <= 10; i++) {
[Link](number + " x " + i + " = " + (number * i));
}
}
}
Explanation:
1. Variable: The variable number is initialized to 14, which is the number for which we want the
multiplication table.
2. For Loop: The loop runs from i = 1 to i = 10, and in each iteration, the product of number and i
is calculated and printed in the format 14 x i = result.
Output:
14 x 1 = 14
14 x 2 = 28
14 x 3 = 42
14 x 4 = 56
14 x 5 = 70
14 x 6 = 84
14 x 7 = 98
14 x 8 = 112
14 x 9 = 126
14 x 10 = 140
This program will print the multiplication table for 14 from 1 to 10.