the mystery of <ctrl-d>



/* if the program is executed as shown below:
* $./a.out
* ges<ctrl-d><ctrl-d>
*
* OUTPUT:
* Number of characters = 3
*
* Question: What happens to the first and second <ctrl-d>?
*/

#include <stdio.h>
#include <stdlib.h>

int main(void)
{
int j;

for (j = 0; getchar() != EOF;j++)
;
fprintf(stdout, "Number of characters = %d\n", j);

exit(EXIT_SUCCESS);
}

.