Computer Science, asked by bhan61, 1 year ago

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 nitish8089
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
nitish8089: i run it . these numbers printed on one line
bhan61: ok
Similar questions