daily pastebin goal
7%
SHARE
TWEET

Untitled

a guest May 17th, 2018 119 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <math.h>
  2. #include <stdio.h>
  3.  
  4.  
  5. using namespace std;
  6.  
  7. double f(double x) { return sqrt(4-x*x) ; }
  8.  
  9. int main()
  10. {
  11.     double x = 1.0, h = 0.01;
  12.     double fc;
  13.     //fc = (f(x+h) - f(x-h))/(2*h);
  14.     //fc = (f(x) - f(x - h)) / h;
  15.     fc = (f(x + h) - f(x)) / h;
  16.     printf("%f\n", fc);
  17.  
  18.     return 0;
  19. }
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