Home Tutorial Java Core Create Multiplication Table from 1 to 10

 
 

Share on Google+Share on Google+
Create Multiplication Table from 1 to 10
Posted on: October 24, 2009 at 12:00 AM
Advertisement
In this section, you will learn how to create multiplication table from 1 to 10 using Java.

Create Multiplication Table in Java

In this section, you will learn how to create multiplication table from 1 to 10. For this purpose, we have created 2-dimensional Array 'array[][]' and using the for loop, we have stored the product of two variables i and j to the array[i][j].

Here is the code:

public class MultiplicationTable{
public static void main(String[] args) {
int[][] array = new int[11][11];
for (int i=1; i<array.length; i++) {
for (int j=1; j<array[i].length; j++) {
array[i][j= i*j;
System.out.print(" " + array[i][j]);
}
System.out.println("");
}
}
}
Advertisement

Related Tags for Create Multiplication Table from 1 to 10:


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: October 24, 2009

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com