I was just reading the marvellous piece on the subject "The C Programming Language" By "Kernighan and Ritchie",it suggested one thing:
While reading a file character by character,using getchar( ),we must use a large data type(like int) to check for EOF,not char.But here my program(taking char) works fine:

char c;
while((c=getchar( ))!=EOF)
putchar(c);

Can someone please help in clearing the confusion?