Linear Algebra and the C Language/a089
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.50000000;
double x2 = +1.00000000;
double x3 = +0.50000000;
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 = 2
n = 2 -> n*x1 = 1.0000 n = 2 -> n*x2 = 2.0000 n = 2 -> n*x3 = 1.0000 n = 2 -> n*x4 = 2.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.5000
n = 1 -> n*x2 = 1.0000
n = 1 -> n*x3 = 0.5000
n = 1 -> n*x4 = 1.0000
Press return to continue
Press X return to stop
Continue until integers appear :
n = 2 -> n*x1 = 1.0000
n = 2 -> n*x2 = 2.0000
n = 2 -> n*x3 = 1.0000
n = 2 -> n*x4 = 2.0000
Press return to continue
Press X return to stop