Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <math.h>
- #include <stdio.h>
- using namespace std;
- double f(double x) { return sqrt(4-x*x) ; }
- int main()
- {
- double x = 1.0, h = 0.01;
- double fc;
- //fc = (f(x+h) - f(x-h))/(2*h);
- //fc = (f(x) - f(x - h)) / h;
- fc = (f(x + h) - f(x)) / h;
- printf("%f\n", fc);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement