Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class MultiplicationTable {
- public static void main(String[] args) {
- Scanner console = new Scanner(System.in);
- int n = Integer.parseInt(console.nextLine());
- int multiplier = Integer.parseInt(console.nextLine());
- if (multiplier <= 10) {
- for (int i = multiplier; i <= 10; i++) {
- System.out.printf("%d X %d = %d%n", n, i, i * n);
- }
- } else {
- System.out.printf("%d X %d = %d%n", n, multiplier, multiplier * n);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment