This is a simple Java program to produce a 12×12 multiplication table using 2-dimensional array.
1 2 |
/**<br /> *<br /> * @Author: Aghatise Osazuwa<br /> * Website: www.cscprogrammingtutorials.com<br /> *<br /> */ <br /><br />public class ArrayMultiplicationTable {<br /><br /> public static void main(String[] args) {<br /> int[][] demo = new int[12][12];<br /> int row = 1, column = 1;<br /> for (int x = 0; x < demo.length; x++) {<br /> for (int y = 0; y < demo[x].length; y++) {<br /> demo[x][y] = row * column;<br /> column = column + 1;<br /> }<br /> row = row + 1;<br /> column = 1;<br /> }<br /> for (int x = 0; x < demo.length; x++) {<br /> for (int y = 0; y < demo[x].length; y++) {<br /> System.out.print(" " + demo[x][y] + "t|");<br /> }<br /> System.out.println();<br /> }<br /> }<br />}<br /> |
See program output below Program output