Code Review Stack Exchange is a question and answer site for peer programmer code reviews. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This is my code:

#include <stdio.h>
#include <ctype.h>

int main()

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

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


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

    return 0;

Is this a good code?

share|improve this question
up vote 1 down vote accepted

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"
share|improve this answer
thank you! i know it dosent do much, but since im a newbie i would love to get feedback like you just wrote so i will know for next time or when i have bigger programs @WilliamMorris – Nir Feb 1 '13 at 13:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.