I\'ve the following program:
#include int main() { int ch; while( ch = getchar() != \'\\n\') { printf(\"Read
ch = getchar() != '\n'
Writing this will cause unexpected behavior depending on the languages operator precedence. In C = is evaluated after != so ch will be true or false. Try:
=
!=
ch
(ch = getchar()) != '\n'