Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- double deriv(double (*) (double),double,double);
- main()
- {
- double x=0.0,dx=0.001;
- printf("%f \n",deriv(cos,x,dx));
- }
- double deriv(double (*f) (double),double x,double dx)
- {
- return ((f(x+dx) - f(x))/dx);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement