import java.util.Scanner; public class Multiplication { public static void main(String[] args) { int rows; int cols; int i,j; Scanner input = new Scanner (System.in); System.out.printf ("Enter the number of rows: "); rows = input.nextInt(); System.out.printf ("Enter the number of columns: "); cols = input.nextInt(); for (i=1; i<=rows; i++) { for (j=1; j<=cols; j++) { System.out.printf("%4d", i*j); } System.out.printf("\n"); } } }