this is an example code frm denis ritchie's book..it accepts ctrl+c as EOF & gives up no no problems..but try changin '\n' to '\t' or ' ' & all hell breaks looseCode:#include<stdio.h> int main(){ int c,nl; nl=0; while((c=getchar())!=EOF) if(c=='\n') ++nl; printf("\n%d\n",nl); return 0; }