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

advertisement

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

advertisement

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

advertisement

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

advertisement

Java Program to Find Transpose of a Matrix

This is a Java Program to Display Transpose Matrix. Enter the elements of array as input. We obtain the transpose of given matrix by interchanging all the rows and columns of a matrix with the help of loops. Here is the source code of the Java Program to Display Transpose Matrix. The Java program is … Read more

advertisement

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

advertisement

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

advertisement

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

advertisement

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

advertisement

Java Program to Find the Frequency of Odd and Even Numbers in Matrix

This is a Java Program to Find the Frequency of Odd & Even Numbers in the given Matrix. Enter the elements of array as input. First we check the elements are either even or odd and hence increment the corresponding variable to get result. Here is the source code of the Java Program to Find … Read more

advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & technical discussions at Telegram SanfoundryClasses.