// Calculate the geometric mean of
// a series of numbers
#include <stdio.h>
#include <math.h>       // pow()

int main(int argc, char **argv)
{
    double count, entry, product, gmean;

    printf("Enter values. 0 ends entry.\n");
    /*
    for (
        count = 0.0, product = 1.0 ;
        EOF  != (retcode = scanf(" %lf", &entry))  &&  entry != 0.0 ;
        count++ ) {

        product *= entry;
    }
*/
    count = 0.0;
    product = 1.0;
    while ( EOF  != scanf(" %lf", &entry)  &&  entry != 0.0 ) {
        product *= entry;
        count++;
    }
    gmean = pow( product, 1.0/count );
    printf("%.0lf values, product is %.3le ; geometric mean is %lf\n",
        count, product, gmean);

    return 0;
}