suresh kumar

suresh kumar

12 Articles Published

Articles by suresh kumar

Page 2 of 2

Program to Print the Squared Matrix in Z form in C

suresh kumar
suresh kumar
Updated on 15-Mar-2026 756 Views

In C programming, printing a squared matrix in Z form means displaying the elements in a specific pattern − first the top row, then the diagonal elements from top-right to bottom-left, and finally the bottom row. This creates a Z-shaped traversal pattern through the matrix. Syntax /* Z-form traversal pattern */ // First row: matrix[0][0] to matrix[0][n-1] // Diagonal: matrix[i][n-1-i] where i goes from 1 to n-2 // Last row: matrix[n-1][1] to matrix[n-1][n-1] Algorithm 1 2 3 ...

Read More

Program to print Lower triangular and Upper triangular matrix of an array in C

suresh kumar
suresh kumar
Updated on 15-Mar-2026 13K+ Views

In C, triangular matrices are special square matrices where elements are zero either above or below the main diagonal. This program demonstrates how to print both lower and upper triangular matrices from a given matrix. Syntax /* Lower Triangular: matrix[i][j] = 0 when j > i */ /* Upper Triangular: matrix[i][j] = 0 when i > j */ Triangular Matrix Types Lower Triangular Matrix − A square matrix where all entries above the main diagonal are zero. Lower Triangular ...

Read More
Showing 11–12 of 12 articles
« Prev 1 2 Next »
Advertisements