Devise a program that counts the number of characters in its input up to the end of file This is my code:

#include &lt;stdio.h&gt;
#include &lt;ctype.h&gt;

int main()

{
    int ch;
    int numberOfCharacters = 0;
    printf("please enter a word, and ctrl + d to see the resault\n");

    while ((ch = getchar()) != EOF &amp;&amp; isprint(ch))

    {
        numberOfCharacters++;
    }

    printf("The number of characters is %d", numberOfCharacters);

    return 0;
}


Is this a good code?
Well, it doesn't do much. But it is not bad. A few issues:


main() should have parameters
excess blank lines (lines 5, 12, 16, 18) spoil the appearance
no \n on the last printf
the spec doesn't say 'printable' characters, just characters.
"please" needs a capital p and "resault" should be "result"