I have a small snippet of code below that I'm running using [PellesC](http://www.smorgasbordet.com/pellesc/).

When the code is executed and I've typed a few characters into the console, I press enter. 

Can you explain to me why the `printf("%ld\n", nc);` line doesn't seem to get executed? As no output is written to the console.

```
#include <stdio.h>

int main(void)
{
    long nc = 0;

    while(getchar() != EOF)
    {
        ++nc;
    }

    printf("%ld\n", nc);
}

```

I've decided to learn C thoroughly using the K&R book and I'm embarrassed to say this rather elementary example has me stumped.