One of my projects from cpsc 123. Can you guess what the out put of this program will be?
#include <math.h>
#include <stdio.h>
int
main ()
{
register float *input;
register int inputQty=0;
register int i=0;
register int avgSum=0;
register float devSum = 0;
register float avg;
register float answer;
register int x=1;
//prompt for the amount of terms
printf ("How many terms? ");
scanf ("%d", &inputQty);
//allocate memory for the terms requested
input = (float *) calloc (inputQty, sizeof (float));
if (input == NULL)
{
printf ("\nError: not enough memory!\n");
exit (1);
}
//get the terms requested
while (i < inputQty) {
printf ("Data%d]: ",x);
x++;
scanf("%f", &input*);
i++;
}
i = 0;
//sum inputted terms
while (i < inputQty) {
avgSum = avgSum + input*;
i++;
}
//calculate average from sum
avg = avgSum / inputQty;
printf("The Average: %.2f\n", avg);
i = 0;
while (i < inputQty) {
devSum = devSum + pow (input* - avg, 2);
i++;
}
answer = sqrt ( devSum * ( 1 / ( (float) inputQty - 1 ) ) );
printf ("The standard deviation: %f\n", answer);
system("pause");
}***