diff --git a/2D Arrays/WavePrintOfMatrix/ColumnWise.c b/2D Arrays/WavePrintOfMatrix/ColumnWise.c new file mode 100644 index 00000000..a8518862 --- /dev/null +++ b/2D Arrays/WavePrintOfMatrix/ColumnWise.c @@ -0,0 +1,38 @@ +#include + +void ColWiseWavePrint(int rows, int cols, int matrix[rows][cols]){ + int i, j; + for(j=0; j=0; i--){ + printf("%d\t", matrix[i][j]); + } + } + } +} + +int main(){ + int rows; + printf("Enter no. of rows: "); + scanf("%d", &rows); + + int cols; + printf("Enter no. of columns: "); + scanf("%d", &cols); + + int matrix[rows][cols]; + int i, j; + for(i=0; i + +void RowWiseWavePrint(int rows, int cols, int matrix[rows][cols]){ + int i, j; + for(i=0; i=0; j--){ + printf("%d\t", matrix[i][j]); + } + } + } +} + +int main(){ + int rows; + printf("Enter no. of rows: "); + scanf("%d", &rows); + + int cols; + printf("Enter no. of columns: "); + scanf("%d", &cols); + + int matrix[rows][cols]; + int i, j; + for(i=0; i