diff --git a/chapter_2/exercise_2_02/loop.c b/chapter_2/exercise_2_02/loop.c index bdc7a52..5cfbb05 100644 --- a/chapter_2/exercise_2_02/loop.c +++ b/chapter_2/exercise_2_02/loop.c @@ -19,15 +19,7 @@ int main(void) { char c = getchar(); - if (i >= (MAXLINE - 1)) - { - loop = 0; - } - else if (c == '\n') - { - loop = 0; - } - else if (c == EOF) + if (i >= (MAXLINE - 1) || c == '\n' || c == EOF) { loop = 0; }