#include <iostream.h>
#include <math.h>

void printtable(double (*f)(double))
// f is a pointer to a function that accepts a double as a parameter
// and returns a double value
{
        cout << 'x' << '\t' << "f(x)" << endl;
        for(double x = 0; x < 10.0; x += 0.5)
                cout << x << '\t' << (*f)(x) << endl;
}

double square(double x)
{
        return x*x;
}

void main(void)
{
        cout << "________________________________________________" << endl;
        printtable(square);
        cout << "________________________________________________" << endl;
        printtable(sin);
        cout << "________________________________________________" << endl;
        printtable(sqrt);
        cout << "________________________________________________" << endl;
}       
