Notice: Uninitialized string offset: 0 in /home/ebullite/candidjava.com/wp-includes/compat.php on line 1

Notice: Uninitialized string offset: 0 in /home/ebullite/candidjava.com/wp-includes/compat.php on line 1

Notice: Uninitialized string offset: 0 in /home/ebullite/candidjava.com/wp-includes/class-wp-meta-query.php on line 1

Notice: Uninitialized string offset: 0 in /home/ebullite/candidjava.com/wp-includes/class-wp-meta-query.php on line 1

Notice: Uninitialized string offset: 0 in /home/ebullite/candidjava.com/wp-includes/l10n.php on line 1

Notice: Uninitialized string offset: 0 in /home/ebullite/candidjava.com/wp-includes/l10n.php on line 1

Notice: Uninitialized string offset: 0 in /home/ebullite/candidjava.com/wp-includes/query.php on line 1

Notice: Uninitialized string offset: 0 in /home/ebullite/candidjava.com/wp-includes/query.php on line 1

Notice: Uninitialized string offset: 0 in /home/ebullite/candidjava.com/wp-includes/class-wp-date-query.php on line 1

Notice: Uninitialized string offset: 0 in /home/ebullite/candidjava.com/wp-includes/class-wp-date-query.php on line 1

Notice: Uninitialized string offset: 0 in /home/ebullite/candidjava.com/wp-includes/theme.php on line 1

Notice: Uninitialized string offset: 0 in /home/ebullite/candidjava.com/wp-includes/theme.php on line 1

Notice: Uninitialized string offset: 0 in /home/ebullite/candidjava.com/wp-includes/class-wp-user-query.php on line 1

Notice: Uninitialized string offset: 0 in /home/ebullite/candidjava.com/wp-includes/class-wp-user-query.php on line 1

Notice: Uninitialized string offset: 0 in /home/ebullite/candidjava.com/wp-includes/rewrite.php on line 1

Notice: Uninitialized string offset: 0 in /home/ebullite/candidjava.com/wp-includes/rewrite.php on line 1

Notice: Uninitialized string offset: 0 in /home/ebullite/candidjava.com/wp-includes/update.php on line 1

Notice: Uninitialized string offset: 0 in /home/ebullite/candidjava.com/wp-includes/update.php on line 1

Notice: Uninitialized string offset: 0 in /home/ebullite/candidjava.com/wp-includes/canonical.php on line 1

Notice: Uninitialized string offset: 0 in /home/ebullite/candidjava.com/wp-includes/canonical.php on line 1

Notice: Uninitialized string offset: 0 in /home/ebullite/candidjava.com/wp-includes/http.php on line 1

Notice: Uninitialized string offset: 0 in /home/ebullite/candidjava.com/wp-includes/http.php on line 1

Notice: Uninitialized string offset: 0 in /home/ebullite/candidjava.com/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php on line 1

Notice: Uninitialized string offset: 0 in /home/ebullite/candidjava.com/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php on line 1

Notice: Uninitialized string offset: 0 in /home/ebullite/candidjava.com/wp-includes/widgets/class-wp-widget-media-image.php on line 1

Notice: Uninitialized string offset: 0 in /home/ebullite/candidjava.com/wp-includes/widgets/class-wp-widget-media-image.php on line 1
Java Example Program for lower triangular matrix
Sample Programs in java

Java Example Program for lower triangular matrix

 

[java]

public class MainLTM {
public static void main(String args[]) {
int[][] a = new int[3][3]; // declaration of an array. here array a
// contain 3-rows and 3-columns.
a[0][0] = 1; // here initializing 1st element of an array
a[0][1] = 0;
a[0][2] = 0;
a[1][0] = 5;
a[1][1] = 1;
a[1][2] = 0;
a[2][0] = 9;
a[2][1] = 6;
a[2][2] = 3;

for (int i = 0; i < a.length; i++) // Here a.length is 3 ie i<3. { for (int j = 0; j < a[i].length; j++) // here a[i].length=3 ie. j<3. { System.out.print(a[i][j] + " "); // here printing an array // elements. } System.out.print("\n"); } } } [/java]

Output

1 0 0

5 1 0

9 6 3