SHARE
TWEET

biraj bro

a guest Feb 26th, 2020 94 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<stdio.h>
  2. #include<conio.h>
  3. #include<math.h>
  4. #define ESP 0.0001
  5. #define X1(X2,X3) ((5-X2-X3)/2)
  6. #define X2(X1,X3) ((15-3*(X1)-2*(X3))/5)
  7. #define X3(X1,X2) ((8 - 2*(X1) - X2)/4)
  8. main()
  9. {
  10.  double x1=0,x2=0,x3=0,y1,y2,y3;
  11.  int i=0;
  12.  printf("\n__________________________________________\n");
  13.  printf("\n x1\t\t x2\t\t x3\n");
  14.  printf("\n__________________________________________\n");
  15.  printf("\n%f\t%f\t%f",x1,x2,x3);
  16.  do
  17.  {
  18.  y1=X1(x2,x3);
  19.  y2=X2(y1,x3);
  20.  y3=X3(y1,y2);
  21.  if(fabs(y1-x1)<ESP && fabs(y2-x2)<ESP && fabs(y3-x3)<ESP )
  22.  {
  23.  printf("\n__________________________________________\n");
  24.  printf("\n\nx1 = %.3lf",y1);
  25.  printf("\n\nx2 = %.3lf",y2);
  26.  printf("\n\nx3 = %.3lf",y3);
  27.  i = 1;
  28.  }
  29.  else
  30.  {
  31.  x1 = y1;
  32.  x2 = y2;
  33.  x3 = y3;
  34.  printf("\n%f\t%f\t%f",x1,x2,x3);
  35.  }
  36.  }while(i != 1);
  37. getch();
  38. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top