Even simpler, you want to write the char
if it is not <space> *and* not <tab> *and* not <newline>
then print it
else
jump to new line
The logical operator that is true only when all its input conditions are true is the *and* operator. Using the 'or' if only one condition is true the output is true.
Now, as AlexN already said, if your input is one of the three spacing codes the other two conditions will be true anyway. So you will never reach the else.
Moreover a comparison is a binary branch meaning that you have two directions you can follow: one if the 'if expression' is true and the other if it false. So you don't need to add another if after else to check again the reverse result.
I suggest you to review logical operators and boolean algebra. (Maybe you want apply the 'break the bar and change the sign' rule to AlexN's proposed 'if (!(c == ' ' || c == '\n' || c == '\t'))' to verify that it is exactly the same reported below using the 'and' operator).
The correct code is simply:
#include <stdio.h>
int main()
{
int c;
while((c = getchar()) != EOF)
{
if(c != ' ' && c != '\n' && c != '\t')
putchar(c);
else
putchar('\n');
}
}
(The brackets around the if are unnecessary because you have only one statement, and also the brackets of the 'while' conditions would be unnecessary because you have only the 'if' block)