#include <stdio.h>

enum { NUM = 5 };
double p[] = {2.38, 3.142, 5.674, 8.257, 6.44};

int main()
{
    double sum, x;
    int n;

    while (1) {
        printf("Please enter next value for x: ");
        if (scanf("%lf", &x) != 1) break;
        for (sum = 0.0, n = NUM-1; n >= 0; --n)
            sum = sum * x + p[n];
        printf("Value: %f\n", sum);
    }

    return 0;
}

