#include <stdio.h> int main() { int n,i; double x,sum; printf("Input the number of values you want to compute stats for: "); scanf("%d",&n); printf("Input the values, separated by whitespace: "); for (i=0,sum=0; i<n && scanf("%lf",&x)!=EOF; i++,sum+=x) ; printf("Sum = %f\nMean = %f\n", sum, sum/n); }