Advertisement
luizaspan

Passando de função para função

Jun 25th, 2015
541
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.25 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. double deriv(double (*) (double),double,double);
  5.  
  6. main()
  7. {
  8.     double x=0.0,dx=0.001;
  9.     printf("%f \n",deriv(cos,x,dx));
  10. }
  11.  
  12. double deriv(double (*f) (double),double x,double dx)
  13. {
  14.     return ((f(x+dx) - f(x))/dx);
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement