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

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 : c00a.c */ /* ------------------------------------ */ #include "v_a.h" /* ------------------------------------ */ /* ------------------------------------ */ #define ARRAY A3 /* ------------------------------------ */ #define RA R5 #define CA C1 #define CB C3 /* ------------------------------------ */ /* ------------------------------------ */ void fun(void) { double **A[ARRAY]; double **B = i_mR(RA,CB); int i; clrscrn(); printf(" The problem:\n\n"); for(i=A0; i<ARRAY; i++) { A[i] = r_mR(i_mR(RA,CA),99); printf(" A[%d] :",i); p_mR(A[i], S5,P0,C6); } stop(); clrscrn(); for(i=A0; i<ARRAY; i++) c_c_mR(A[i],C1, B,i+C1); printf(" A solution:\n\n"); printf(" A[0] A[1] A[2] :"); p_mR(B, S6,P0,C10); for(i=A0; i<ARRAY; i++) f_mR(A[i]); f_mR(B); } /* ------------------------------------ */ int main(void) { time_t t; srand(time(&t)); do { fun(); } while(stop_w()); return 0; } /* ------------------------------------ */ /* ------------------------------------ */ The problem with the solution: Screen output example: The problem: A[0] : +18 -23 -91 +12 -31 A[1] : -83 -95 +64 +88 +94 A[2] : +28 -94 -94 -87 +89 Press return to continue. A solution: A[0] A[1] A[2] : +18 -83 +28 -23 -95 -94 -91 +64 -94 +12 +88 -87 -31 +94 +89 Press return to continue Press X return to stop