#include "matrix.h" void prn_info(const char *pgm_name) { printf("%s%d%s%d%s", "Matrices of size mxn will be created dynamically\n" "and filled with randomly distributed integers\n" "in the interval [", -N, ", ", N, "].\n" "\n"); } void prn_matrix(char *mtrx_name, matrix a, int m, int n, FILE *ofp) { int i, j; if (a == NULL) { fprintf(ofp, "%s DOES NOT EXIST\n\n", mtrx_name); return; } fprintf(ofp, "%s =", mtrx_name); for (i = 1; i <= m; ++i) { for (j = 1; j <= n; ++j) { if (j % NCOL == 1) putc('\n', ofp); fprintf(ofp, "%7.1f", a[i][j]); } if (n > NCOL) putc('\n', ofp); } fprintf(ofp, "\n\n"); }