This is an easy problem.
All you need to do is to print the first 10 multiples of the number given in input.
Input:
An integer N, whose first 10 multiples need to be printed.
Output:
First 10 multiples of number given in input
Constraints:
1 <= N <= 5000
SAMPLE INPUT
3
SAMPLE OUTPUT
3
6
9
12
15
18
21
24
27
30
Explanation
Here N = 3.
So first 10 multiples of 3 have to be printed.


Solution-


import java.util.*;
class Table{
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int sum=1;
        for (int i=1;i<=10;i++)
         {
            sum=n*i;
            System.out.println(sum);
         }
    }
}

Post a Comment

Previous Post Next Post