I am currently writing a program in c that is to do a few equations via functions. The possible data that is going to be read is up to 1 million two precision floating numbers excluding 0. I am getting an error when I try to count the number of numbers read into the array, but for some reason I get a default value of 264 every single time I run the program. So for instance if dont input any values I get a count of 264, 1 value 265, 2 values 266 and so on. I guess I could subtract 264 from count to get the accurate total but I want to know why this is happening and where the 264 comes from. I have attached the code I have so far below. Thank you.
#include <stdio.h>
#include <stdlib.h>
#define N 1000000
int count_num(double numbers[]);
double sum(double numbers[]);
double max(double numbers[]);
double min(double numbers[]);
double ar_mean(double numbers[]);
double har_mean(double numbers[]);
double variance(double numbers[]);
int main(void)
{
double numbers[N];
int i =0;
while(scanf("%lf.2",&numbers[i])!=EOF&&i<N)
{
i++;
}
int count=count_num(numbers);
printf("Count: %d\n", count);
}
int count_num(double numbers[])
{
int count=0;
for(int i=0;i<N;i++)
{
if((numbers[i]!=0)&&(numbers[i]!=0.0))
{
count++;
}
}
return count;
}