Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

Linear Algebra and the C Language/a05e

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

__NOTOC__ Install and compile this file in your working directory. /* ------------------------------------ */ /* Save as : cof_r.c */ /* ------------------------------------ */ #include "v_a.h" /* ------------------------------------ */ void fun(int n) { double **A = r_mR(i_mR(n,n),99.); int r = rp_I(n); int c = rp_I(n); clrscrn(); printf(" A :"); p_mR(A,S5,P0,C6); printf(" minor(R%d,C%d) = %+.3f\n" " cofactor(R%d,C%d) = %+.3f\n\n\n", r,c, minor_R(A, r,c), r,c, cofactor_R(A, r,c)); printf(" cofactor(R%d,C%d) = minor(R%d,C%d)*(-1**(R%d+C%d))\n" " = minor(R%d,C%d)*(%0.0f)\n", r,c, r,c, r,c, r,c, pow(-1,(r+c))); f_mR(A); } /* ------------------------------------ */ int main(void) { time_t t; srand(time(&t)); do { fun(rp_I(RC5)+C1); } while(stop_w()); return 0; } /* ------------------------------------ */ /* ------------------------------------ */ Screen output example: A : +22 -6 +79 +92 minor(R1,C1) = +92.000 cofactor(R1,C1) = +92.000 cofactor(R1,C1) = minor(R1,C1)*(-1**(R1+C1)) = minor(R1,C1)*(1) Press return to continue Press X return to stop