Advertisement
Guest User

Untitled

a guest
Nov 16th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.45 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <math.h>
  4. int main()
  5. {
  6.     double c, eps, x, x1, x2;
  7.    
  8.     printf("Wczytaj c = ");
  9.     scanf("%f\n", &c);
  10.     printf("Wczytaj eps = ");
  11.     scanf("%f\n", &eps);
  12.    
  13.     x1 = c;
  14.     x2 = (1/2) * ( x1 + (c / x1) );
  15.    
  16.     if ( fabs(x1 - x2) < eps)
  17.     {
  18.         x =
  19.     }
  20.     else
  21.     {
  22.         x1 = x2;
  23.         x2 = (1/2) * ( x1 + (c / x1));
  24.     }
  25.  
  26.        
  27.     return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement