You should change your parenthesis to
while((c = getchar()) != EOF)
Because the "=" operator has a lower precedence than the "!=" operator. Then you will get the expected results. Your expression is equal to
while (c = (getchar()!= EOF))
You are getting the two 1's as output, because you are making the comparison "c!=EOF". This will always become one for the character you entered and then the "\n" that follows by hitting return. Except for the last comparison where c really is EOF it will give you a 0.
EDIT about EOF: EOF is typically -1, but this is not guaranteed by the standard. The standard only defines about EOF in section 7.19.1:
EOF which expands to an integer
constant expression, with type int and
a negative value, that is returned by
several functions to indicate
end-of-file, that is, no more input
from a stream;
It is reasonable to assume that EOF equals -1, but when using EOF you should not test against the specific value, but rather use the macro.