/* 
 * Example of using function parameter  
 * 
 */ 

#include <stdio.h> 
#include <math.h> 

void evaluate(double f(double f_arg), double pt); 
double fcubic(double x); 

int 
main()
{
    double x; 

    printf("Input the value for the function > "); 
    scanf("%lf", &x); 

    evaluate(sqrt, x); 

    return 0; 

} 

void evaluate(double fcubic(double x), double pt)
{
    double f_pt; 
    f_pt =  fcubic(pt); 
    printf("fcubic(%.5f) = %.5f\n",pt,f_pt); 
} 

double fcubic(double x)
{
   return (pow(x,3) - 2.0*x + 5.0); 
                    
} 

             
             


   



