Hi guys,

I tried to do the tutorials on Linux to get the average number. However I get some nonsense number. I am using Linux, can it be a problem for storing memory in different way?
int main()
    int i, howMany;
    int total;
    float average = 0.0;
    int * pointsArray;

    printf("How many numbers do you want to average? \n");
    scanf(" %d", &howMany);

    pointsArray = (int *) malloc(howMany * sizeof(int));

    printf("Enter them \n");

    for (i=0; i<howMany; i++) {
        scanf(" %d", &pointsArray);
        total += pointsArray;

    average = (float)total / (float)howMany;
    printf(" %f \n", average);

return 0;