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/a053

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 : mulr.c */ /* ------------------------------------ */ #include "v_a.h" /* ------------------------------------ */ int main(void) { double a[R3*C3] ={ 1, 2, 3, 1, 2, 3, 1, 2, 3}; double **A = ca_A_mR(a,i_mR(R3,C3)); double s = 10; int r = R1; clrscrn(); printf(" A :"); p_mR(A,S5,P0,C6); printf(" mulR_mR(A, %+.0f, R%d)\n\n",s,r); printf(" A :"); p_mR(mulR_mR(A,s,r),S5,P0,C6); f_mR(A); stop(); return 0; } /* ------------------------------------ */ /* ------------------------------------ */ Multiplies the row r by a scalar: Screen output example: A : +1 +2 +3 +1 +2 +3 +1 +2 +3 mulR_mR(A, +10, R1) A : +10 +20 +30 +1 +2 +3 +1 +2 +3 Press return to continue.