Java Day 5: Loops
Given an integer,n , print its first 10 multiples. Each multiple n x i (where 1<= i <= 10) should be printed on a new line in the form: n x i = result.
- import java.io.*;
- import java.math.*;
- import java.security.*;
- import java.text.*;
- import java.util.*;
- import java.util.concurrent.*;
- import java.util.regex.*;
-
- public class Solution {
- public static void main(String[] args) {
- Scanner in = new Scanner(System.in);
- int N = in.nextInt();
- in.close();
-
- for (int i = 1; i < 11; i++) {
- System.out.println(N + " x " + i + " = " + N * i);
- }
- }
- }