the output should be
rows 5
column 5
1 2 3 4 5 =120
2 4 6 8 10 =3840
3 6 9 12 15 =29160
4 8 12 16 20 =122880
5 10 15 20 25 =375000
=120 =3840 =29160 =122880 =375000
it means getting the product of each row and each column
import javax.swing.*; public class activity2 { public static void main(String []args) { int r=Integer.parseInt(JOptionPane.showInputDialog(null,"rows")); int c=Integer.parseInt(JOptionPane.showInputDialog(null,"cols")); int table[][]= new int [r][c]; for(int i=0;i<=table.length-1;i++){ for(int j=0; j<=table[0].length-1;j++){ table [i][j]= (i+1)*(j+1); if(table[i][j]<0) System.out.print(table[i][j]+"\t"); else if(table[i][j] >10 && table [i][j] <100) System.out.print(table[i][j]+"\t"); else System.out.print(table[i][j]+"\t"); } System.out.println(""); } } }