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

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 : c00b.c */ /* ------------------------------------ */ #include "v_a.h" /* ------------------------------------ */ int main(void) { int n = 1; double x1 = +0.25000000; double x2 = +1.25000000; double x3 = +0.75000000; double x4 = +1.00000000; do{ clrscrn(); printf(" Continue until integers appear : \n\n\n"); printf(" n = %d -> n*x1 = %0.4f \n",n, n*x1); printf(" n = %d -> n*x2 = %0.4f \n",n, n*x2); printf(" n = %d -> n*x3 = %0.4f \n",n, n*x3); printf(" n = %d -> n*x4 = %0.4f \n",n, n*x4); n++; }while(stop_w()); return 0; } /* ------------------------------------ */ /* ------------------------------------ */ With n = 4 n = 4 -> n*x1 = 1.0000 n = 4 -> n*x2 = 5.0000 n = 4 -> n*x3 = 3.0000 n = 4 -> n*x4 = 4.0000 This gives us the coefficients of the equation: “Simply replace x1, x2,... with their numerical values: Screen output example: Continue until integers appear : n = 1 -> n*x1 = 0.2500 n = 1 -> n*x2 = 1.2500 n = 1 -> n*x3 = 0.7500 n = 1 -> n*x4 = 1.0000 Press return to continue Press X return to stop Continue until integers appear : n = 2 -> n*x1 = 0.5000 n = 2 -> n*x2 = 2.5000 n = 2 -> n*x3 = 1.5000 n = 2 -> n*x4 = 2.0000 Press return to continue Press X return to stop Continue until integers appear : n = 3 -> n*x1 = 0.7500 n = 3 -> n*x2 = 3.7500 n = 3 -> n*x3 = 2.2500 n = 3 -> n*x4 = 3.0000 Press return to continue Press X return to stop Continue until integers appear : n = 4 -> n*x1 = 1.0000 n = 4 -> n*x2 = 5.0000 n = 4 -> n*x3 = 3.0000 n = 4 -> n*x4 = 4.0000 Press return to continue Press X return to stop