Can anyone tell me how to fix the code below so that the last char of my input file is not printed out twice? I know you might be wondering what I am doing..haha..but it is just the skeleton for a bigger program. Thanks..
Code:int main(void) { char c; while( (c=getchar()) != EOF ) { ungetc(c,stdin); printf("%c\n",c); } return 0; }