Skip to content

Commit

Permalink
Merge pull request #72 from SamiNasry/fix-c-code-error
Browse files Browse the repository at this point in the history
Logic Error fixed in Solution
  • Loading branch information
ohkimur authored Sep 15, 2024
2 parents c9532ab + 12eb91d commit b6cc99f
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions chapter_2/exercise_2_02/loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit b6cc99f

Please sign in to comment.