Advertisement
CR7CR7

10.MultiplicationTable

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