C   75
2darray
Guest on 11th February 2023 01:17:49 PM


  1. #include <stdio.h>
  2.  
  3. void multiply(int rows, int cols, int array[rows][cols], int multiplier) {
  4.     int i, j;
  5.  
  6.     for (i = 0; i < rows; i++) {
  7.         for (j = 0; j < cols; j++) {
  8.             array[i][j] *= multiplier;
  9.         }
  10.     }
  11. }
  12.  
  13. void print(int rows, int cols, int array[rows][cols]) {
  14.     int i, j;
  15.  
  16.     for (i = 0; i < rows; i++) {
  17.         for (j = 0; j < cols; j++) {
  18.             printf("%5i ", array[i][j]);
  19.         }
  20.         printf("\n");
  21.     }
  22. }

Raw Paste

Login or Register to edit or fork this paste. It's free.