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
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.
C Solution
Java Solution
So first 10 multiples of 3 have to be printed.
C Solution
#include <stdio.h>
int main(){
int num;
scanf("%d", &num);
for(int i=1;i<=10;i++)
printf("%d\n", num*i);
}
import java.util.*;
class TestClass {
public static void main(String args[] ) throws Exception {
Scanner s = new Scanner(System.in);
int num=s.nextInt();
for(int i=1;i<=10;i++)
System.out.println(num*i);
}
}

0 Comments