Write a method Met that takes as parameters an integer and prints the first ten multiples of the integer.
Only write the method - assume that the Class & main method have been defined.
Print the multiples on a single line, separated by a space character. At the end of the line, print a new line.
Example Input: 5
Output: 5 10 15 20 25 30 35 40 45 50
Example Input: 7
Output: 7 14 21 28 35 42 49 56 63 70
Answers
Answered by
3
public static void met(int x){
for(int i=1;i<=10;i++){
System.out.print(x*i);
if(i<10){
System.out.print(" ");
}
else{
System.out.println();
}
}
}
bhan61:
those numbers are not printing in one line can u chage it
Similar questions
English,
7 months ago
Social Sciences,
7 months ago
Hindi,
7 months ago
Science,
1 year ago
Math,
1 year ago
Chemistry,
1 year ago
Psychology,
1 year ago