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 & Comments
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();
}
}
}