![[Dept of Engineering]](http://www.eng.cam.ac.uk/images/house_style/engban-s.gif)
#include <stdio.h>
#include <stdlib.h>
/* c89 -L/usr/local/lib g01aaf.c -lnag -lcl */
main(){
int i;
int n, iwt, ifail;
double x[10], wt[10];
double xmean, s2, s3, s4, xmin, xmax, wtsum;
iwt = 0;
n = 10;
ifail = 0;
for (i=0;i<10;i++){
wt[i]=1;
x[i]= 3.5 * i;
}
g01aaf(&n, x, &iwt, wt, &xmean, &s2, &s3, &s4,
&xmin, &xmax, &wtsum, &ifail);
if (ifail == 0){
printf("Mean is %lf, Std deviation is %lf\n", xmean, s2);
printf("Max is %lf, min is %lf\n", xmax, xmin);
}
else
printf("G01AAF failed\n");
}