why does this work
but this doesnt?Code:printf ("Please enter a sentence"); while ((ch = getchar()) != '.') { //i know that '\n' would terminate on new line character if (ch == '.' || ch == '!' || ch == '?') break; sentence[i++] = ch;
the scond code doesn't teminateCode:printf ("Please enter a sentence"); while ((ch = getchar()) != '.' || ch != '!' || ch != '?') { sentence[i++] = ch;