diff --git a/Matrix_programs/Transpose_of_matrix.cpp b/Matrix_programs/Transpose_of_matrix.cpp new file mode 100644 index 0000000..05b8a1b --- /dev/null +++ b/Matrix_programs/Transpose_of_matrix.cpp @@ -0,0 +1,52 @@ +/* +Enter size of matrix-->3 + + Enter the elements of the array +4 7 0 +2 5 8 +4 3 8 + + Matrix is + 4 7 0 +2 5 8 +4 3 8 + + Tranpose of the matrix is + 4 2 4 +7 5 3 +0 8 8 +*/ +#include + +void main() + +{ + int a[20][20],i,j,n; + printf("Enter size of matrix-->"); + scanf("%d",&n); + printf("\n Enter the elements of the array \n"); + for(i=0;i +void main() +{ + int a,b,c,rows; + printf("Enter the number of rows: "); + scanf("%d", &rows); + for(a=1;a<=rows;a++) + { + for(b=rows-1;b>a;b--) + { + printf(" "); + } + printf("\n"); + for(c=1;c<=a;c++) + { + printf("%d",c); + + + } + } +} + + +