#define EOF (-1)
You don't need to redefine EOF(already #defined in "stdio.h").
file = scanf("%d", &number);
You need to put this line in a loop to take consecutive inputs.
while((file = scanf("%d", &number)) == 1 && file!=EOF){
sum += number;
sum_squares += number * number;
++n;
}//repalces line 8 to 17
input:
sdev < input.dat
where input.dat contains
1
2
3
4
output:
The average is 2.500000
The standard deviation is 1.118034