Advertisement
veronikaaa86

10. Multiplication Table

Sep 14th, 2022
1,055
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.45 KB | None | 0 0
  1. package BasicSyntax;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class P10MultiplicationTable {
  6.     public static void main(String[] args) {
  7.         Scanner scanner = new Scanner(System.in);
  8.  
  9.         int n = Integer.parseInt(scanner.nextLine());
  10.  
  11.         int times = 1;
  12.         while (times <= 10) {
  13.             int product = n * times;
  14.  
  15.             System.out.printf("%d X %d = %d%n", n, times, product);
  16.  
  17.             times++;
  18.         }
  19.     }
  20. }
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement