I have the main code I want to use written out. All I need to do is get the user to input five numbers. Then once they insert the numbers I need them to be inputted into the array so that they can be calculated. I have tried to understand how to successfully get user input and use it, but have been unable to figure it out.
int
main (int argc, char **argv)
{
int number1;
int number2;
int number3;
int number4;
int number5;
int a[5];
printf("Enter a number\n");
scanf ("%d, number1");
printf("Enter a number\n");
scanf ("%d, number2");
printf("Enter a number\n");
scanf ("%d, number3");
printf("Enter a number\n");
scanf ("%d, number4");
printf("Enter a number\n");
scanf ("%d, number5");
a[0] = number1;
a[1] = number2;
a[2] = number3;
a[3] = number4;
a[4] = number5;
int mean = (a[0] + a[1] + a[2] + a[3] + a[4]) / 5;
int difference0 = a[0] - mean;
int difference1 = a[1] - mean;
int difference2 = a[2] - mean;
int difference3 = a[3] - mean;
int difference4 = a[4] - mean;
int variance = ((difference0 * difference0) + (difference1 * difference1) + (difference2 * difference2) + (difference3 * difference3) + (difference4 * difference4)) / 5;
double sdeviation = sqrt(variance);
printf("the mean of the array is %d\n",mean);
printf("the variance of the array is %d\n",variance);
printf("the standard deviation of the array is %f\n",sdeviation);
return 0;
}