## Java Program to Find the Sum and Product of Elements in a Row/Column

This is the Java Program to Find the Sum and Product of Elements in a Row/Column. Problem Description Given a square matrix, print the sum and product of the elements in each row and column. Example: Matrix: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Output: Sum … Read more

## Java Program to Find the Row with Maximum Number of 1s

This is the Java Program to Find the Row with the Maximum Number of 1’s in a Sorted Matrix. Problem Description Given a boolean matrix of 0’s and 1’s, where each row is sorted, print the row first with the maximum number of 1’s. Example: Matrix: 0 0 1 1 0 0 1 1 0 … Read more

## Java Program to Find the Column with Maximum Number of 1s

This is the Java Program to Find the Column with the Maximum Number of 1’s in a Sorted Matrix. Problem Description Given a boolean matrix of 0’s and 1’s, where each column is sorted, print the first column with the maximum number of 1’s. Example: Matrix: 0 0 0 1 0 0 1 1 0 … Read more

## Java Program to Find the Maximum Square Matrix with All 1’s

This is the Java Program to Find the Largest Square Matrix with all 1’s. Problem Description Given a boolean matrix of 0’s and 1’s, find and print the largest square sub-matrix whose all the entries are 1. Example: Matrix: 0 0 1 1 0 1 1 1 0 0 0 1 Output: 1 1 1 … Read more

## Java Program to Find Transpose of a Matrix

Transpose of a Matrix in Java is the new matrix formed by interchanging its rows and columns. The transpose of the matrix is denoted by using the letter “T” in the superscript of the given matrix. For example, if “A” is the given matrix, then the transpose of the matrix is represented by A’ or … Read more

## Java Program to Find the Trace and Normal of a Matrix

This is a Java Program to Find the Trace & Normal of a given Matrix. The Trace of a matrix is the sum of main diagonal whereas the Normal is the square root of the sum of squares of all elements of a matrix. Enter all the elements of matrix as input. We find the … Read more

## Java Program to Display Upper and Lower Triangular Matrix

This is the Java Program to Display Upper/Lower Triangle of a Matrix. Problem Description Given a square matrix, print it’s upper and lower triangle. Example: Matrix: 0 0 1 1 0 1 1 1 0 0 0 1 0 0 0 0 Output: Upper Triangle 0 0 1 1 0 1 1 0 0 0 … Read more

## Java Program to Display Lower Triangular Matrix

This is a Java Program to Display Lower Triangular Matrix. Enter the elements of array as input. We use loops and if-else conditions to print only the diagonals and the elements below diagonal as it is and rest of the elements as zeros. Here is the source code of the Java Program to Display Lower … Read more

## Java Program to Interchange Any Two Rows and Columns in the Matrix

This is a Java Program to Interchange any two Rows & Columns in the given Matrix. Enter the elements of array as input. Now select the option whether you want to interchange rows or columns. We use loops to interchange columns or rows respectively. Here is the source code of the Java Program to Interchange … Read more 