Editorial Staff - - C Programming Tutorial
In this program, we are going to share a C Program to print lower diagonal of a matrix. If you are a beginner and want to start learning the C programming, then keep your close attention in this tutorial as I am going to share a C Program to print lower diagonal of a matrix with the output.
We have designed this program for beginners for learning purpose. Copy below c program and execute it with c compiler to see the output of the program.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | #include <stdio.h> #define ROW 4 #define COL 4 int main() { int matrix[ROW][COL] = {{3,4,5},{5,6,7},{7,8,9}}; printf("Lower Triangular Matrix\n"); for(int i=0; i<4; i++) { for(int j=0; j<4; j++) { if(i>=j) printf("%d ", matrix[i][j]); else printf("%d ", 0); } printf("\n"); } return 0; } |
Lower Triangular Matrix
3 0 0 0
5 6 0 0
7 8 9 0
0 0 0 0
Editorial Staff at FreeWebMentor is a team of professional developers leads by Prem Tiwari View all posts by Editorial Staff