Write a program to generate a multiplication table such as the following “9 times table”:
Answers
Answered by
1
Answer:
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print("Table of which no. ? ");
int num = sc.nextInt();
System.out.println("Table of " + num + " ---");
for (int i = 1; i <= 10; i++) {
System.out.println(num + " × " + i + " = " + num*i);
}
}
}
Similar questions
Math,
1 month ago
Math,
1 month ago
Computer Science,
2 months ago
English,
10 months ago
Environmental Sciences,
10 months ago
Math,
10 months ago